]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCVoice.cxx
Melchior FRANZ:
[flightgear.git] / src / ATC / ATCVoice.cxx
index 71d9f5fc8248545c2b94c9b053892266fed87ad9..82721f420a9881d4dc703e0d3e84666013ba55fb 100644 (file)
@@ -37,21 +37,26 @@ FGATCVoice::FGATCVoice() {
 }
 
 FGATCVoice::~FGATCVoice() {
-       delete SoundData;
+    free( rawSoundData );
+    delete SoundData;
 }
 
 // Load the two voice files - one containing the raw sound data (.wav) and one containing the word positions (.vce).
 // Return true if successful.
 bool FGATCVoice::LoadVoice(string voice) {
+    // FIXME CLO: disabled to try to see if this is causign problemcs
+    // return false;
+
        ifstream fin;
 
        SGPath path = globals->get_fg_root();
-       string soundPath = "ATC/" + voice + ".wav";
-       path.append(soundPath);
+       path.append( "ATC" );
+
+        string file = voice + ".wav";
        
-       SoundData = new slSample( (char*)path.c_str() );
-       rawDataSize = SoundData->getLength();
-       rawSoundData = (char*)SoundData->getBuffer();
+       SoundData = new SGSoundSample( path.c_str(), file.c_str(), false );
+       rawDataSize = SoundData->get_size();
+       rawSoundData = SoundData->get_data();
        
        path = globals->get_fg_root();
        string wordPath = "ATC/" + voice + ".vce";