Although you could use sendBin to play a sound on the robot, a specific and efficient method has been written for this purpose: sendSound.
client->sendSound(sound, "endsound");
The first parameter is a USound structure describing the sound to send. The second is an optionnal tag that will be used by the server to issue a "stop" system message when the sound has finished playing. The function convert can be used to convert between various sound formats.
There is no limit to the size of the sound buffer, since it will be automatically cut into small chunks by the library. The data is copied by the library: the USound parameter and its associated data can be safely freed as soon as the function returns.