In case you want to do this for MP3. Here's what I'm using: It uses pydub and scipy. Full setup (on Mac, may differ on other systems): import tempfile import os import pydub import scipy import scipy.io.wavfile def read_mp3(file_path, as_float = False): """ Read an MP3 File into numpy data. Add a comment. You can bypass the 100 character rule by splitting the 'theText' string into an array: theText = f.read ().split ("") (i used "" as the delimiter) put the delimiter in the text every sentence or space before 100 characters. Create a for-loop: engine.Speak (section) audio2numpy load an audio file and directly ouputs the audio data as a numpy array and its sampling rate. Supports .wav, .aiff via python's standard library, and .mp3 via ffmpeg. Installation. Using pip: pip install audio2numpy FFmpeg for decoding mp3. audio2numpy requires ffmpeg to decode mp3 files. If your ffmpeg is installed you need to add the path of ffmpeg to your environment variables' PATH. I'll explain for windows. First, find out where your ffmpeg is installed. Simple python script to convert m4b audio books to a group of mp3 files split by chapter. - GitHub - valekhz/m4b-converter: Simple python script to convert m4b audio books to a group of mp3 files split by chapter. It's recommended to replace the .mkv extension with .wav extension (not just adding .wav): wav_file_name = filename.replace('.mkv', '.wav') Make sure that the MKV files are in the correct path, and that you have read permissions to the files, and write permissions to the folder. Hello, I am trying convert Mp3 to Wav for my program. from pydub import AudioSegment # files src = 'C:\\\\Users\\\\resource\\\\Desktop\\\\Python\\\\API_Tesseract So there are two things you can do: Get the raw bytes of your sound (e.g. using pygame.mixer.Sound (filename).get_raw (), or for simple sounds you could create them mathematically) and decode that in base64 format. Wrap the original (MP3/OGG encoded) file data in a BytesIO object, which is a file-like object, so the Sound module will treat it Audacity is an excellent audio application which can show a real time spectrogram of your input audio file sonic-visualiser is another essential audio tool for this purpose they will confirm what a proper spectrogram of your audio should look like to understand how to code up one I suggest you invest time understanding the notion of a fourier transform just slogging on some using lame (command line), you can encode wav to mp3 like this: $ lame --preset insane /path/to/file.wav which would create: file.wav.mp3 in Python, you could use subprocess to call it: wav = 'myfile.wav' cmd = 'lame --preset insane %s' % wav subprocess.call(cmd, shell=True) IL9tc.