Created
April 20, 2009 22:29
-
-
Save coderberry/98806 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
| class SoxEncoder | |
| attr_accessor :input_files, :output_file, :command_line | |
| def initialize | |
| @input_files = [] | |
| end | |
| def input_file=(filename) | |
| @input_files << filename | |
| end | |
| def convert | |
| if @input_files.length > 0 | |
| @command_line = "sox #{@input_files.join(' ')} #{@output_file}" | |
| else | |
| raise ArgumentError, "No input file specified." | |
| end | |
| return run_command | |
| end | |
| def run_command | |
| raise ArgumentError, "No output file specified." unless @output_file | |
| puts @command_line | |
| if system @command_line | |
| return true | |
| else | |
| return false | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment