Fade out using a handle and set channel volume oncomplete

Hi

I would like to fade out audio when Storyboard changes scene. Since this is not streaming audio I don’t specify a channel at any point. I’ve managed to fade out this audio passing the handle to the audio.fadeOut functio, nowever since I don’t name a channel at any stage I’m unsure how to target the channel which has just been turned down to zero and turn it back up so the system can use it again.

Is there a way of finding out which channel is playing a simple sound which isn’t streaming so I can chnage the volume of this channel when fadeOut is complete?

many thanks

J [import]uid: 103802 topic_id: 27032 reply_id: 327032[/import]

I would recommend still assigning a channel and handle.

You can retrive whether a channel is playing or not via this api: http://developer.anscamobile.com/reference/index/audioischannelplaying [import]uid: 84637 topic_id: 27032 reply_id: 109679[/import]

Do NOT pass a handle to audio.fadeOut. It requires a channel. Expect that kind of thing to behave unpredictably or crash.

audio.play() returns the channel your sound is assigned to. Save that value and use it to know which channel to fade or change volume on.
[import]uid: 7563 topic_id: 27032 reply_id: 109755[/import]

Thanks Ewing, that sounds like just what I need - so if I start an audio clip playing using audio.play can you give me an example of the code I would need to retrieve the channel I can then pass to the fadeOut?
[import]uid: 103802 topic_id: 27032 reply_id: 109850[/import]