This is a note for myself on the issue of extracting audio from different audio/video containers/formats using CLI commands on the Mac. However I thought it might be also useful for readers of #osxchat.
Best-case scenario: it can be played by mplayer, so almost no programs are required to be installed, since we all installed MPlayer OSX Extended. Here is how to do it in a bash script:#!/bin/bash
mplayer="/Applications/MPlayer OSX Extended.app/\
Contents/Resources/Binaries/mpextended.mpBinaries/\
Contents/mpextended.mpBinaries/Contents/MacOS/mplayer"
cd ~/Downloads/ for myfile in *.flv *.avi; do
myfn=${myfile%\.*}
"$mplayer" -vo null -ao pcm:file=${myfn}.wav $myfile
done
more example! mplayer -dumpstream http://127.0.0.1/news/tvbs/20100616/L/L20100616-59.wmv