Audio trimmer for ruby powered by sox. Get the gem at [audio-trimmer] (https://rubygems.org/gems/audio-trimmer).
First ensure that you have sox installed. Sox is a sound processing library and toolkit.
For fedora/centos:
$ dnf install sox
For Ubuntu/Debian
$ apt-get install sox
For MacOSX
$ brew install sox
Next, get the gem
$ gem install audio-trimmer
Simple example:
require 'audio_trimmer'
trimmer = AudioTrimmer.new '/path/to/input_file'
# if not specified, output file set to the input file
trimmer.trim start:0, finish:35, output:'/path/to/output_file'
Trim from a position to the end of the file. Just omit the finish field. e.g.
require 'audio_trimmer'
trimmer = AudioTrimmer.new input: '/path/to/input_file'
# trim from 35 second mark to end of file
trimmer.trim start:35, output:'/path/to/output_file
You can also use audio-trimmer from your shell.
$ audio_trimmer [input file] -s=[start trim] -f=[finish trim] -o=[output file]
Enjoy!