Created
February 25, 2014 18:49
-
-
Save WilCF/9215134 to your computer and use it in GitHub Desktop.
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
There's a script you can run that divides an audio clip into small segments. | |
The following code splits an mpeg into optionally overlapping snippets of audio for transcription or whatever... | |
#NOTE! you must install ffmpeg in your system first (http://ffmpeg.org/download.html): $brew install FFmpeg | |
overlap = XX #overlap between snippets in seconds | |
total_length = XX #total length of file in seconds | |
step_size = XX #length of snippets in seconds | |
file_path = "" #path to audio file | |
file_name = File.basename(file_path, '.*') | |
(0..total_length).step(step_size) { |x| `ffmpeg -ss #{x-overlap} -i #{file_path} -c copy -t #{step_size+overlap} #{file_name}-out-#{x}.mp3` } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment