nxtlib/src/Protocol.cs
/// <summary> 
/// [Native] Plays a sound file from the NXT.
/// </summary>
/// <param name="loop">Set to true to loop the sound until stopped.</param>
/// <param name="filename">The name of the sound file (.rso) on the NXT.</param>
[Native] Plays a sound file from the NXT.
[ Native ] Plays a sound file from the NXT .
public void PlaySoundFile(bool loop, string filename)
        {
            filename = ValidateFilename(filename, FileType.Sound, true);
            byte[] request = new byte[23];
            request[0] = (byte)(0x00);
            request[1] = (byte)(DirectCommand.PlaySoundFile);
            request[2] = (byte)(loop ? 0xFF : 0x00);
            Encoding.ASCII.GetBytes(filename).CopyTo(request, 3);
            CompleteRequest(request);
            return;
        }
public void PlaySoundFile ( bool loop , string filename ) { filename = ValidateFilename ( filename , FileType . Sound , true ) ; byte [ ] request = new byte [ 23 ] ; request [ 0 ] = ( byte ) ( 0x00 ) ; request [ 1 ] = ( byte ) ( DirectCommand . PlaySoundFile ) ; request [ 2 ] = ( byte ) ( loop ? 0xFF : 0x00 ) ; Encoding . ASCII . GetBytes ( filename ) . CopyTo ( request , 3 ) ; CompleteRequest ( request ) ; return ; }
[Native] Plays a sound file from the NXT.
[ Native ] Plays a sound file from the NXT .
loop
bool
Set to true to loop the sound until stopped.
Set to true to loop the sound until stopped .
filename
string
The name of the sound file (.rso) on the NXT.
The name of the sound file ( . rso ) on the NXT .