]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIPlane.cxx
Catch sound exceptions at the earliest, report problem has an alert, and continue...
[flightgear.git] / src / ATC / AIPlane.cxx
index 6191558b44a25ee6384ea3ec77005ec8e9f668dc..3bcb4e5482d073c4f79a9b1984256782e9c025d6 100644 (file)
@@ -181,14 +181,15 @@ void FGAIPlane::ProcessCallback(int code) {
 // Outputs the transmission either on screen or as audio depending on user preference
 // The refname is a string to identify this sample to the sound manager
 // The repeating flag indicates whether the message should be repeated continuously or played once.
-void FGAIPlane::Render(string refname, bool repeating) {
+void FGAIPlane::Render(const string& refname, bool repeating) {
+       fgSetString("/sim/messages/ai-plane", pending_transmission.c_str());
 #ifdef ENABLE_AUDIO_SUPPORT
        voice = (voiceOK && fgGetBool("/sim/sound/voice"));
        if(voice) {
                int len;
                unsigned char* buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), len, voice);
                if(voice) {
-                       SGSoundSample* simple = new SGSoundSample(buf, len, 8000, false);
+                       SGSoundSample* simple = new SGSoundSample(buf, len, 8000);
                        // TODO - at the moment the volume is always set off comm1 
                        // and can't be changed after the transmission has started.
                        simple->set_volume(5.0 * fgGetDouble("/instrumentation/comm[0]/volume"));
@@ -216,7 +217,7 @@ void FGAIPlane::Render(string refname, bool repeating) {
 
 
 // Cease rendering a transmission.
-void FGAIPlane::NoRender(string refname) {
+void FGAIPlane::NoRender(const string& refname) {
        if(playing) {
                if(voice) {
 #ifdef ENABLE_AUDIO_SUPPORT