Re: NSSound doesn't play
Re: NSSound doesn't play
- Subject: Re: NSSound doesn't play
- From: Chris Kane <email@hidden>
- Date: Sat, 26 Jul 2003 20:43:06 -0700
On Saturday, July 26, 2003, at 08:04, Lorenzo wrote:
I have a problem with two NSSounds just before a small animation starts
If I recall correctly, the 10.2 developer release notes for AppKit
talked about this. NSSound, when it's using QuickTime to play sounds
(which, in 10.2, it does for all but the simplest sounds), requires the
NSRunLoop (or AppKit's event loop) to be run for sound to
play/continue. You can't start a sound playing then go off and do
something else.
This is because QuickTime requires the run loop to be run to "task" the
movie which NSSound contains. NSSound doesn't spawn off a background
thread to do this for you in 10.2 because QuickTime is not very
thread-safe. I've heard the situation may have improved in Panther
(don't quote me), but also that it's still a good idea to only play a
Movie in the same thread in which it is created.
NSSound has moved over to CoreAudio for most sound formats for Panther,
I understand, but still uses QuickTime for sound formats only supported
up at that layer. For example, Apple Music Store downloads. So
NSSound would still need the run loop to be run to ensure the sound
gets play whatever the source. [And of course, if you want your app to
run on 10.2 AND Panther, you can't take advantage of any better
behavior in Panther.]
And of course, with Panther being an announced but unshipped product,
any statements above may have no relation to what may or may not be
true of it.
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.