- SGSoundSample *simple =
- new SGSoundSample((unsigned char*) buf.c_str(),
- buf.length(), 8000, AL_FORMAT_MONO8);
- // TODO - at the moment the volume can't be changed
- // after the transmission has started.
- simple->set_volume(volume);
- globals->get_soundmgr()->add(simple, refname);
- if(repeating) {
- globals->get_soundmgr()->play_looped(refname);
- } else {
- globals->get_soundmgr()->play_once(refname);
- }
- } catch ( sg_io_exception &e ) {
- SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
+ SGSoundSample *simple = new SGSoundSample(&buf, len, 8000);
+ simple->set_volume(volume);
+ _sgr->add(simple, refname);
+ _sgr->play(refname, repeating);
+ } catch ( sg_io_exception &e ) {
+ SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
+ }