Read audio and music meta data and duration of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA, Wave and AIFF files with python 2 or 3 audio music mp4 mp3 wav flac ogg opus wma m4a aiff Updated Nov 30, 2023
To check that the wav files have their header, use soxi: rob@tp:~/wavs$ soxi test.wav Input File : 'test.wav' Channels : 1 Sample Rate : 16000 Precision : 16-bit Duration : 00:00:12.62 = 201984 samples ~ 946.8 CDDA sectors File Size : 404k Bit Rate : 256k
Here's an example that worked for me. If you put the recorded audio into a speech_recognition AudioData object, there are methods available for converting to various audio formats (e.g., get_wav_data(), get_aiff_data(), get_flac_data(), etc.). See here: speech_recognition AudioData
. 166 46 0 156 388 167 314 140 319