Error With Pydub In Python
i have successfully imported pydub but for the code: from pydub import AudioSegment song = AudioSegment.from_mp3('c:\mks.mp3') first_ten_seconds = song[:10000] song.export('d:\mks.
Solution 1:
The only issue that I see with your code is trailing ";" at the end of last 3 line. Please remove those, and see if you still get the error.
In addition, make sure you have ffmpeg (http://www.ffmpeg.org/) installed. It is required for the support of all of the none wav file formats.
ADDED:
I think you have broken module dependencies in your python installation. I have tried code that you provided above with python 2.7.2. It worked fine for me:
>>>from pydub import AudioSegment>>>song = AudioSegment.from_wav('goodbye.wav')>>>first_ten_seconds = song[:10000]>>>song.export('goodbye1.wav',format='wav')
<open file 'goodbye1.wav', mode 'wb+' at 0x10cf2b270>
Post a Comment for "Error With Pydub In Python"