How to stop and effect sound that is looping.

24 views
Skip to first unread message

Mad Pig

unread,
Nov 20, 2014, 2:12:05 AM11/20/14
to objectal-...@googlegroups.com
Hi, 
First off, awesome sound engine! I found a cpu degrade bug in sprite kit sounds, so I tried AVaudio and found it ruined performance. I tried some other openAL libs and found them not quite up to snuff. This one is sweet!

I'd like to know how to stop a looping sound. This is how I'm using it..

        simpleAL.playEffect(attackShipBSound, loop: true)


I know there is the stopAllEffects, but I only want to stop this one. I don't want the other playing effects to stop. Any ideas? 

Thanks!
Derrick

Karl Stenerud

unread,
Nov 20, 2014, 8:32:07 AM11/20/14
to objectal-...@googlegroups.com
It returns a reference to the sound source that’s playing the effect, so:

id<ALSoundSource> source = [simpleAL playEffect:attackShipBSound loop:true];

and later:

[source stop];

--
You received this message because you are subscribed to the Google Groups "ObjectAL-for-iPhone" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectal-for-ip...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mad Pig

unread,
Nov 20, 2014, 10:53:50 PM11/20/14
to objectal-...@googlegroups.com
Awesome. Thanks so much. And thanks for making this awesome thing! I've never seen such well documented code!

Mark E Anderson

unread,
Nov 20, 2014, 11:20:18 PM11/20/14
to objectal-...@googlegroups.com
Karl is in the hall of fame as far as I'm concerned. 

-Mark
Reply all
Reply to author
Forward
0 new messages