Page 1 of 1

How to use Player to play some short audio file (MP3 or WAV)

Posted: Fri Oct 16, 2009 6:06 am
by alex298
Hello,

Platform: Windows

I wish to use RR to play some very short external audio files (MP3 or WAV) for a program. Actually I don't need the Play button, Rewind buttons, Pause button, etc... I just wish to play the audio file like that:

If theNumber = 3 then
## Play the short audio file 3.wav here
end if

I read the Tutorial of Callbacks from RR official website. It seems that Player may be the solution.

Could some experts here provide the guideline for me?

Thanks and best regards

Posted: Fri Oct 16, 2009 8:41 am
by Mark
Dear alex298,

You almost got it right:

Code: Select all

if theNumber = 3 then
  play "path to audio file 3.wav here"
end if
You don't really need a player object here, but if you want to embed the sound file in your stack, you can import them (see File menu) and use the following script:

Code: Select all

if theNumber = 3 then
  play "name of audio clip 3.wav here"
end if
Best,

Mark

Posted: Mon Oct 19, 2009 11:10 pm
by hliljegren
Mark wrote: You don't really need a player object here, but if you want to embed the sound file in your stack, you can import them (see File menu) and use the following script:

Code: Select all

if theNumber = 3 then
  play "name of audio clip 3.wav here"
end if
Best,

Mark
Well, if alex298 wants to play "MP3 or waw" he needs to use a player as the built-in support does not support mp3 (AFAIK)

Posted: Mon Oct 19, 2009 11:13 pm
by Mark
hliljegren,

Why mp3? Alex seems to be happy with wav.

Mark