Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Detecting when sound finishes playing in "Crash Landing" Sound Engine

scotopiascotopia Posts: 2,074Registered Users
edited May 2009 in iOS SDK Development
Hello all,

I am using the sound engine class in apple's sample "Crash Landing" app for my audio needs, and I was curious if there was some kind of way to detect when a sound has finished ending and to take action at that moment; similar to the way you can fire a function at the end of an animation block. I tried looking through the .cpp file but I got a little lost. Any help you can offer would be much appreciated. Thanks!
Post edited by scotopia on
<div align="center"><br />
<br />
<a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
<br />
<a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi
·

Replies

  • scotopiascotopia Posts: 2,074Registered Users
    edited November 2008
    I am still at a loss and need to figure this out rather quickly; can anyone assist?
    <div align="center"><br />
    <br />
    <a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
    <br />
    <a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi
    ·
  • DenVogDenVog Posts: 625Registered Users
    edited May 2009
    scotopia wrote: »
    way to detect when a sound has finished ending and to take action at that moment

    Did you ever figure this out Scotopia? I am trying to start/stop an animation so that it is only occurring while a sound is playing.
    ·
  • wuf810wuf810 Posts: 1,052Registered Users @ @ @ @
    edited May 2009
    DenVog wrote: »
    Did you ever figure this out Scotopia? I am trying to start/stop an animation so that it is only occurring while a sound is playing.

    use AVAudioplayer instead.
    ·
  • deansxdeansx Posts: 127Registered Users
    edited May 2009
    scotopia wrote: »
    Hello all,

    I am using the sound engine class in apple's sample "Crash Landing" app for my audio needs, and I was curious if there was some kind of way to detect when a sound has finished ending and to take action at that moment; similar to the way you can fire a function at the end of an animation block. I tried looking through the .cpp file but I got a little lost. Any help you can offer would be much appreciated. Thanks!

    SoundEngine is layered on top of OpenAL. I'm certainly not an expert on OpenAL, but I'm pretty sure that there isn't any way to register a callback for when a sound has finished playing in OpenAL, so the functionality can't be easily implemented in SoundEngine. About the best that you can do is extend the SoundEngine API to test for whether the effect is still playing. I've done this in our working copy of SoundEngine, and would be happy to share with you, if you're interested.

    Good Luck,

    dean
    BluMtnWerx
    <a href="http://www.blumtnwerx.com" target="_blank"><font face="System"><b><font color="Blue">BluMtnWerx</font></b></font><br />
    </a><br />
    <i>Developers of:</i><blockquote><a href="http://www.blumtnwerx.com/TiltBall.html" target="_blank">TiltBall and T
    ·
  • DenVogDenVog Posts: 625Registered Users
    edited May 2009
    deansx wrote: »
    way to register a callback for when a sound has finished playing

    Does this help?
    AudioServicesAddSystemSoundCompletion(soundOne, NULL, NULL, simpleSoundDone, NULL);
    

    I have not figured out a way to use it to stop an animation in progress...
    ·
Sign In or Register to comment.