Posted By

reboltutorial on 05/22/10



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


quick alarm with sound

 / Published in: R


I was looking for a freeware for a quick sound alarm and surprisingly couldn’t any that was really quick to use. Naturally I thought about using Rebol and happily this is going to be really easy with the wait and the open sound:// command.

You can then create an alarm like this

alarm 5 or like this:

alarm 5 "attention"

  1. alarm: func[seconds message [string! unset!]][
  2. wav: load %attention.wav
  3. sound-port: open sound://
  4. wait seconds do [
  5. insert sound-port wav
  6. wait sound-port
  7. close sound-port
  8. if (value? 'message) [
  9. print message
  10. ]
  11. ]
  12. ]

Report this snippet  

You need to login to post a comment.