Re: NSSound needs a run loop cycle to repeat-play a sound?
Re: NSSound needs a run loop cycle to repeat-play a sound?
- Subject: Re: NSSound needs a run loop cycle to repeat-play a sound?
- From: Michael Ash <email@hidden>
- Date: Sat, 28 Mar 2009 23:10:24 -0400
On Sat, Mar 28, 2009 at 2:11 AM, Jerry Krinock <email@hidden> wrote:
> If I invoke NSSound to play the same sound more than once, without cycling
> through a run loop, it only plays the first time, and other times, fails
> "silently". [1]
>
> If I cycle through a run loop, then it works fine. [2]
>
> The documentation states that NSSounds play in a separate thread and I don't
> see any explanation for this in "Sound Programming Topics for Cocoa". Is
> this a bug or is it too late for me to be trying to read?
I'd call it a documentation deficit. Probably worth filing a bug
reading, roughly, "Half of the APIs in Cocoa assume that the calling
thread has an active runloop, but aren't documented as having this
requirement." NSSound is far from alone in this respect.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden