lib/audio_hero.rb
# Concat takes in an array of audio files (same format) and concatenate them.
Concat takes in an array of audio files (same format) and concatenate them.
Concat takes in an array of audio files ( same format ) and concatenate them .
def concat(options={})
      output_format = options[:output_format] ? options[:output_format] : "wav"
      dst = Tempfile.new(["out", ".#{output_format}"])
      files = get_array(@file)
      begin
        parameters = files.dup
        parameters << ":dest"
        parameters = parameters.flatten.compact.join(" ").strip.squeeze(" ")
        success = Cocaine::CommandLine.new("sox", parameters).run(:dest => get_path(dst))
      rescue => e
        raise AudioHeroError, "There was an error joining #{@file}"
      end
      dst
    end
def concat ( options = { } ) output_format = options [ :output_format ] ? options [ :output_format ] : "wav" dst = Tempfile . new ( [ "out" , ".#{output_format}" ] ) files = get_array ( @file ) begin parameters = files . dup parameters << ":dest" parameters = parameters . flatten . compact . join ( " " ) . strip . squeeze ( " " ) success = Cocaine :: CommandLine . new ( "sox" , parameters ) . run ( :dest => get_path ( dst ) ) rescue => e raise AudioHeroError , "There was an error joining #{@file}" end dst end
Concat takes in an array of audio files (same format) and concatenate them.
Concat takes in an array of audio files ( same format ) and concatenate them .
# no garbage collect option for join
options