Jerry Krinock wrote:

On 2009 Aug 03, at 11:28, James Walker wrote:

I'm having trouble getting sounds to play reliably. When it happens, -[NSSound play] returns YES, but I hear nothing, and the sound:didFinishPlaying: delegate method is not called. The sound in question is an AIFF file with a duration of about half a second.

Maybe it depends on whether a sound has already been played since the run loop last cycled? If that might be the case, read this...

http://www.cocoabuilder.com/archive/message/cocoa/2009/3/29/233317

Since this was not critical for me at the time, I just accepted Michael's assertion and haven't done any more investigation.

No, I definitely wasn't playing more than one sound per trip through the event loop.

I rewrote my sound playing function to use SystemSoundPlay instead of NSSound, and now it seems to work every time. Of course, using SystemSoundPlay means that the sound won't play if the user unchecks "play user interface sound effects" in the Sound preference panel, but that may actually be appropriate in my case.
--
  James W. Walker, Innoventive Software LLC
  <http://www.frameforge3d.com/>
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to