Skip to content

Instantly share code, notes, and snippets.

@michaelwills
Last active February 23, 2016 09:28
Show Gist options
  • Select an option

  • Save michaelwills/de3d2296110c40ecb80f to your computer and use it in GitHub Desktop.

Select an option

Save michaelwills/de3d2296110c40ecb80f to your computer and use it in GitHub Desktop.

Revisions

  1. michaelwills revised this gist Feb 23, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions snippets.sh
    Original file line number Diff line number Diff line change
    @@ -7,5 +7,6 @@ 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 -acodec pcm_s16le -ac 1 -ar 16000 outfile.raw
    #doh! so simple!
    % 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
  2. michaelwills revised this gist Feb 23, 2016. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions snippets.sh
    Original file line number Diff line number Diff line change
    @@ -3,3 +3,9 @@

    # 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 -acodec pcm_s16le -ac 1 -ar 16000 outfile.raw
    #doh! so simple!
  3. michaelwills revised this gist Dec 12, 2015. No changes.
  4. michaelwills revised this gist Dec 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion snippets.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@
    % 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 48k -t raw outfile.raw
    sox infile.wav -b 16 -s -c 1 -r 16k -t raw outfile.raw
  5. michaelwills created this gist Dec 12, 2015.
    5 changes: 5 additions & 0 deletions snippets.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # 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 48k -t raw outfile.raw