Anonymous user
Audio alarm: Difference between revisions
added a ruby example
Thundergnat (talk | contribs) m (→{{header|Ring}}: Remove vanity tags) |
(added a ruby example) |
||
Line 397:
[https://www.dropbox.com/s/9l5fef83wj61zw5/AudioAlarm.avi?dl=0 AudioAlarm]
=={{header|Ruby}}==
<lang ruby>
requires mpg123 to be installed.
puts "Enter a number of seconds:"
seconds = gets.chomp.to_i
puts "Enter a MP3 file to be played"
mp3filepath = File.dirname(__FILE__) + "/" + gets.chomp + ".mp3"
sleep(seconds)
pid = fork{ exec 'mpg123','-q', mp3filepath }
</lang>
=={{header|Tcl}}==
|