LEGO NXT Cannot Play a Sound File
Question
I cannot play a sound file.
The PlaySoundFile command (0x02) returns a success 0x00 as a command status but the sound file is not played.
What could be the reason for that?
Answer
There are several possible reasons for the
NXT to ignore the PlaySoundFile command:
- Wrong loop argument- loop argument can only be 0x00 for playing once or 0x01 for loop;
- The volume on the NXT’s brick is set to 0;
- The file name argument value is not a sound file (RSO file);
In order to play a sound file correctly, make sure that:
- The volume in the NXT brick is set to more than 0;
The loop argument value is 0x00 for playing once or 0x01 for loop;- The file name should be an existing RSO file on NXT’s brick flash memory;
- The name of the sound file is exactly 19 characters and 0x00 byte as NULL terminator. In case the file name is less than 19 characters, add 0x00 byte for each missing character. The bytes of file name and type characters should be ASCII encoded.
The syntax of the PlaySoundFile command is:
[0x17] [0x00] [0x00 or 0x80] [0x02] [0x00 or 0x01] [fileName.rso]
For more information about this command and its arguments check the
How to make LEGO NXT to play a sound tutorial.
For more information about how to convert a wav file to RSO file check the
Lego NXT Pre- Defined Text to Speech tutorial.
why do wifes cheat
go why people cheat in marriage