Last active
February 23, 2016 09:28
-
-
Save michaelwills/de3d2296110c40ecb80f to your computer and use it in GitHub Desktop.
sphinx 4 audio preparation snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use ffmpeg to extract audio from video file | |
% ffmpeg -i infile.mp4 -acodec pcm_s16le -ac 1 -ar 16000 outfile.wav | |
# use sox to convert to raw | |
sox infile.wav -b 16 -s -c 1 -r 16k -t raw outfile.raw | |
# https://trac.ffmpeg.org/wiki/audio%20types | |
# use ffmpeg to extract RAW! audio from video file | |
ffmpeg -i input -f s16le -acodec pcm_s16le output.raw | |
% ffmpeg -i infile.mp4 -f s16le -acodec pcm_s16le -ac 1 -ar 16000 outfile.raw | |
#doh! so simple! But that `-f s16le` looks like it is needed | |
# http://stackoverflow.com/questions/4854513/can-ffmpeg-convert-audio-to-raw-pcm-if-so-how |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment