Get AeonWave up to par again by removing a number of errors, and fixing a unit type for the audio cone inner and outer angle.

This commit is contained in:
Erik Hofman 2019-11-07 15:15:02 +01:00
parent 1a4568175c
commit ece2f913a1
3 changed files with 15 additions and 10 deletions

View File

@ -257,7 +257,7 @@ void SGSoundMgr::stop()
if (is_working()) {
_active = false;
TRY( d->_aax.set(AAX_STOPPED) );
TRY( d->_aax.set(AAX_PROCESSED) );
_renderer = "unknown";
_vendor = "unknown";
@ -411,11 +411,8 @@ void SGSoundMgr::release_source( unsigned int source )
if ( source_it != d->_sources.end() )
{
aax::Emitter& emitter = source_it->second;
enum aaxState state = emitter.state();
if (state != AAX_PROCESSED) {
TRY( emitter.set(AAX_PROCESSED) );
TRY( d->_aax.remove(emitter) );
}
TRY( emitter.remove_buffer() );
d->_sources.erase(source_it);
}
@ -621,7 +618,7 @@ bool SGSoundMgr::is_sample_stopped(SGSoundSample *sample)
assert(sample->is_valid_source());
aax::Emitter& emitter = d->get_emitter(sample->get_source());
int result = emitter.state();
return (result == AAX_STOPPED);
return (result == AAX_PROCESSED);
#else
return true;
#endif
@ -651,9 +648,9 @@ void SGSoundMgr::update_sample_config( SGSoundSample *sample, SGVec3d& position,
TRY( emitter.set(dsp) );
if ( sample->has_static_data_changed() ) {
dsp = emitter.get(AAX_ANGULAR_FILTER);
TRY( dsp.set(AAX_INNER_ANGLE, sample->get_innerangle()) );
TRY( dsp.set(AAX_OUTER_ANGLE, sample->get_outerangle()) );
dsp = emitter.get(AAX_DIRECTIONAL_FILTER);
TRY( dsp.set(AAX_INNER_ANGLE, sample->get_innerangle(), AAX_DEGREES) );
TRY( dsp.set(AAX_OUTER_ANGLE, sample->get_outerangle(), AAX_DEGREES) );
TRY( dsp.set(AAX_OUTER_GAIN, sample->get_outergain()) );
TRY( emitter.set(dsp) );

View File

@ -29,6 +29,10 @@ int main( int argc, char *argv[] ) {
smgr->set_volume(0.9);
smgr->activate();
// prevent NaNs
SGQuatd orient = SGQuatd::fromYawPitchRollDeg(0.0, 0.0, 0.0);
smgr->set_orientation( orient );
SGPath srcDir(SRC_DIR);
SGSoundSample *sample1 = new SGSoundSample("jet.wav", srcDir);

View File

@ -30,6 +30,10 @@ int main( int argc, char *argv[] ) {
SGPath srcDir(SRC_DIR);
// prevent NaNs
SGQuatd orient = SGQuatd::fromYawPitchRollDeg(0.0, 0.0, 0.0);
smgr->set_orientation( orient );
printf("default position and orientation\n");
SGSoundSample *sample1 = new SGSoundSample("jet.wav", srcDir);
sample1->set_volume(1.0);