Syd Adams:
Patch to enable atc chatter (and any other arbitrary "message" audio file) to be played at any specified volume. (Previously these messages were always played at a hardcoded volume of 1.0)
This commit is contained in:
parent
f9e288fce2
commit
c8986567ae
3 changed files with 5 additions and 4 deletions
|
@ -1157,8 +1157,9 @@ do_play_audio_message (const SGPropertyNode * arg)
|
|||
FGFX *fx = (FGFX *)globals->get_subsystem("fx");
|
||||
string path = arg->getStringValue("path");
|
||||
string file = arg->getStringValue("file");
|
||||
double volume = arg->getDoubleValue("volume");
|
||||
// cout << "playing " << path << " / " << file << endl;
|
||||
fx->play_message( path, file );
|
||||
fx->play_message( path, file, volume );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -187,17 +187,17 @@ FGFX::update (double dt)
|
|||
void
|
||||
FGFX::play_message( SGSoundSample *_sample )
|
||||
{
|
||||
_sample->set_volume( 1.0 );
|
||||
_samplequeue.push( _sample );
|
||||
}
|
||||
void
|
||||
FGFX::play_message( const string path, const string fname )
|
||||
FGFX::play_message( const string path, const string fname, double volume )
|
||||
{
|
||||
if (globals->get_soundmgr()->is_working() == false) {
|
||||
return;
|
||||
}
|
||||
SGSoundSample *sample;
|
||||
sample = new SGSoundSample( path.c_str(), fname.c_str() );
|
||||
sample->set_volume( volume );
|
||||
play_message( sample );
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
* in order.
|
||||
*/
|
||||
void play_message( SGSoundSample *_sample );
|
||||
void play_message( const string path, const string fname );
|
||||
void play_message( const string path, const string fname, double volume );
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Reference in a new issue