This shows you the differences between two versions of the page.
built_in:nxt_playsoundfile [2015/03/25 11:20] madlyr [PlaySoundFile] |
built_in:nxt_playsoundfile [2015/03/25 19:20] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PlaySoundFile ====== | ||
- | The **PlaySoundFile** function commands the NXT brick to play a sound file (.rso) file which is available on the brick. | ||
- | |||
- | The **file** parameter should be the name of the sound file and the **repeat** parameter should be number of times you want the sound to repeat. | ||
- | Format for **file** ASCIIZ string with maximum size [15:3 chars]. | ||
- | < | ||
- | |||
- | ====Example - Play the ' | ||
- | <code javascript> | ||
- | function OnStart() | ||
- | { | ||
- | nxt = app.CreateNxt(); | ||
- | app.SetMenu( " | ||
- | } | ||
- | |||
- | function OnMenu( name ) | ||
- | { | ||
- | if( name==" | ||
- | nxt.ShowDevices(); | ||
- | else if( name==" | ||
- | nxt.PlaySoundFile( " | ||
- | } | ||
- | </ |