#include "AIPlane.hxx"
-SGSampleGroup *FGAIPlane::_sgr = 0;
-
FGAIPlane::FGAIPlane() {
leg = LEG_UNKNOWN;
tuned_station = NULL;
_rollSuspended = false;
if ( !_sgr ) {
- SGSoundMgr *smgr;
- smgr = (SGSoundMgr *)globals->get_subsystem("soundmgr");
+ SGSoundMgr *smgr = globals->get_soundmgr();
_sgr = smgr->find("atc", true);
+ _sgr->tie_to_listener();
}
}
#ifdef ENABLE_AUDIO_SUPPORT
voice = (voiceOK && fgGetBool("/sim/sound/voice"));
if(voice) {
- string buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), voice);
+ size_t len;
+ void* buf = vPtr->WriteMessage(pending_transmission, &len);
if(voice && (volume > 0.05)) {
- SGSoundSample* simple =
- new SGSoundSample((unsigned char*)buf.c_str(), buf.length(), 8000 );
- // TODO - at the moment the volume can't be changed
- // after the transmission has started.
+ SGSoundSample* simple = new SGSoundSample(&buf, len, 8000 );
simple->set_volume(volume);
_sgr->add(simple, refname);
_sgr->play(refname, repeating);