/usr/share/doc/libao-ruby1.8/examples/test.rb is in libao-ruby1.8 0.1-1ubuntu3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/usr/bin/env ruby
require 'audiooutput'
audioOutput = AudioOutput.new
driver_type = AudioOutput::driver_info(AudioOutput::default_driver_id)["type"]
case driver_type
when AudioOutput::AO_TYPE_LIVE
if !audioOutput.open_live \
AudioOutput::default_driver_id, 16, 44100, 2, 0
$stderr.print "Can't open_live\n"
exit 1
end
when AudioOutput::AO_TYPE_FILE
if !audioOutput.open_file \
AudioOutput::default_driver_id, "out.raw", true, 16, 44100, 2, 0
$stderr.print "Can't open_file\n"
exit 1
end
else
$stderr.print "Don't know about driver type #{driver_type}\n"
exit 1
end
audioOutput.play(STDIN.read)
|