require "linux/SoundDSP" require "audiofile" dsp = File.new("/dev/dsp", "w").extend(Linux::SoundDSP) ARGV.each do |filename| wav = AudioFile.new filename dsp.bits, dsp.rate, dsp.channels = [wav.bits, wav.rate, wav.channels] bytes = dsp.write(wav.read 10000) until bytes == 0 wav.close end dsp.close