]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIPlane.cxx
Vassilii Khachaturov:
[flightgear.git] / src / ATC / AIPlane.cxx
index 32cea572b0138617807d0962ea3aec1468ddc4a7..6191558b44a25ee6384ea3ec77005ec8e9f668dc 100644 (file)
@@ -22,7 +22,7 @@
 #include <Main/fg_props.hxx>
 #include <simgear/math/point3d.hxx>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/sound/soundmgr.hxx>
+#include <simgear/sound/soundmgr_openal.hxx>
 #include <math.h>
 #include <string>
 SG_USING_STD(string);
@@ -90,8 +90,8 @@ void FGAIPlane::Update(double dt) {
        // TODO - turn it off if user switches to another freq - keep track of where in message we are etc.
        if(_transmit) {
                //cout << "transmit\n";
-               double user_freq0 = fgGetDouble("/radios/comm[0]/frequencies/selected-mhz");
-               double user_freq1 = fgGetDouble("/radios/comm[1]/frequencies/selected-mhz");
+               double user_freq0 = fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
+               double user_freq1 = fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
                _counter = 0.0;
                _max_count = 5.0;               // FIXME - hardwired length of message - need to calculate it!
                
@@ -183,16 +183,15 @@ void FGAIPlane::ProcessCallback(int code) {
 // The repeating flag indicates whether the message should be repeated continuously or played once.
 void FGAIPlane::Render(string refname, bool repeating) {
 #ifdef ENABLE_AUDIO_SUPPORT
-       voice = (voiceOK && fgGetBool("/sim/sound/audible")
-                 && fgGetBool("/sim/sound/voice"));
+       voice = (voiceOK && fgGetBool("/sim/sound/voice"));
        if(voice) {
                int len;
                unsigned char* buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), len, voice);
                if(voice) {
-                       SGSimpleSound* simple = new SGSimpleSound(buf, len);
+                       SGSoundSample* simple = new SGSoundSample(buf, len, 8000, false);
                        // 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("/radios/comm[0]/volume"));
+                       simple->set_volume(5.0 * fgGetDouble("/instrumentation/comm[0]/volume"));
                        globals->get_soundmgr()->add(simple, refname);
                        if(repeating) {
                                globals->get_soundmgr()->play_looped(refname);