2016年3月9日 星期三

make thinkdsp to play a sound in windows

make thinkdsp to play a sound

1. download ffmpeg for windows
2. uncompress it ===> ffplay.exe, ffmpeg.exe,... and the others
3. copy ffplay.exe to C:\Anaconda3\Scripts, or any other directory where window's path can point to
----

4. when using play_wave() in thinkdsp, using the following :

>>> play_wave(player = 'ffplay')
or
>>> play_wave(player = 'ffplay  -autoexit')  # this will make ffplay quit after it finish the playing

or
HACK into the source code thinkdsp.py

goto this line:
    def play_wave(filename='sound.wav', player='aplay'):



change it to be:
    def play_wave(filename='sound.wav', player='ffplay -autoexit'):

----

if you have difficulty to download ffmpeg , and then uncompress it,
please try this:

ffplay.exe


沒有留言:

張貼留言