As you can see, the WAV header is the only difference between WAV and PCM file formats. The assumption is that you are recording 16 bit PCM MONO audio (which according to your code, you are). The rawToWave function just neatly adds headers to the WAV file, so that music players know what to expect when your file is opened, and then after the Let’s see the code for some functionalities of pydub library: 1) Playing Audio File: This is done using play () method. Python3. from pydub import AudioSegment. from pydub.playback import play. wav_file = AudioSegment.from_file (file = "Sample.wav", format = "wav") play (wav_file) Output: Generally speaking, converting between audio formats is easy. Doing text to speech in the first place is very hard . So focus on the hard part first, get that solved, then deal with the specific requirements of the output format at the end. Just wanted to post my example too using NAudio.Lame: NuGet: Install-Package NAudio.Lame Code Snip: Mine obviously returns a byte[] - I have a separate save to disk method b/c I think it makes unit testing easier. Convert MP3 to WAV with iTunes. To use it convert audio files, go to “preferences” by clicking on “edit”. Select “general” and click “import settings”. Click the drop down next to “import using” and select “WAV encoder”. Select the songs that you wish to convert, click “file”, choose “create new version” and WAV to MP3 Converting WAV to MP3 Using FFmpeg. Using FFmpeg might be complicated for some users. To give you an idea of how audio file format conversions take place on the software, here is a detailed explanation of how to convert a WAV file to an MP3 file using FFmpeg: Install FFmpeg: If you have not already, download and install the software Step four. Start the queue to encode the MP3 and export your new WAV file. Dive deeper on the WAV converter abilities of Media Encoder to see a more detailed rundown of the encoding process steps for music files and more. Media Encoder also gives you the option to do parallel encoding, so you can export multiple converted files at the same time First you need to add file for conversion: drag and drop your MP3 file or click the "Choose File" button. Then click the "Convert" button. When MP3 to MIDI conversion is completed, you can download your MIDI file. ⏱️ How long does it take to convert MP3 to MIDI? 5J72JkL.