rbrigden / audio-trimmer-ruby

Audio trimmer for ruby powered by sox. Gem available at audio-trimmer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gem Version

audio-trimmer-ruby

Audio trimmer for ruby powered by sox. Get the gem at [audio-trimmer] (https://rubygems.org/gems/audio-trimmer).

Installation

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

General Usage

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

Command Line Usage

You can also use audio-trimmer from your shell.

$ audio_trimmer [input file] -s=[start trim] -f=[finish trim] -o=[output file]

Enjoy!

About

Audio trimmer for ruby powered by sox. Gem available at audio-trimmer


Languages

Language:Ruby 100.0%