User Tools

Site Tools


built_in:nxt_playsoundfile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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]. 
-<code>nxt.PlaySoundFile( file, repeat );</code> 
- 
-====Example - Play the 'Woops' sound file==== 
-<code javascript> 
-function OnStart() 
-{ 
-  nxt = app.CreateNxt(); 
-  app.SetMenu( "Connect,Play Sound" ); 
-} 
- 
-function OnMenu( name ) 
-{ 
-  if( name=="Connect" ) 
-    nxt.ShowDevices(); 
-  else if( name=="Play Sound" ) 
-    nxt.PlaySoundFile( "Woops.rso", 0 ); 
-} 
-</code> 
built_in/nxt_playsoundfile.txt ยท Last modified: 2015/03/25 19:20 (external edit)