• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSSound play often fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSound play often fails


  • Subject: Re: NSSound play often fails
  • From: James Walker <email@hidden>
  • Date: Mon, 03 Aug 2009 14:09:48 -0700

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@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


References: 
 >NSSound play often fails (From: James Walker <email@hidden>)
 >Re: NSSound play often fails (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Table view data source methods order?
  • Next by Date: "unlockFocus called too many time" console message
  • Previous by thread: Re: NSSound play often fails
  • Next by thread: Re: NSSound play often fails
  • Index(es):
    • Date
    • Thread