AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds) { AUD_Reference<AUD_IFactory> silence = new AUD_SilenceFactory; AUD_Reference<AUD_IFactory> limiter = new AUD_LimiterFactory(silence, 0, seconds); AUD_device->lock(); try { AUD_Handle handle2 = AUD_device->play(limiter); if(!handle2.isNull()) { handle2->setStopCallback((stopCallback)pauseSound, handle); AUD_device->unlock(); return new AUD_Handle(handle2); } } catch(AUD_Exception&) { } AUD_device->unlock(); return NULL; }
AUD_Handle* AUD_play(AUD_Sound* sound, int keep) { assert(sound); try { AUD_Handle handle = AUD_device->play(*sound, keep); if(!handle.isNull()) return new AUD_Handle(handle); } catch(AUD_Exception&) { } return NULL; }