• 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: NSBeep() blocks for some users
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBeep() blocks for some users


  • Subject: Re: NSBeep() blocks for some users
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 20 Jul 2011 08:59:57 -0700

On Jul 20, 2011, at 8:13 AM, Glenn L. Austin wrote:

>> I've had a few users complain that if my app calls NSBeep() many times in
>> quick succession the program blocks until each of the beeps has played
>> sequentially. I can't reproduce this: on my system, NSBeep() returns
>> immediately and a subsequent call to NSBeep() will cause the sound to stop
>> and restart. Is there any reason why some machines would behave differently?
>
> The sounds used for the beeps may be different formats, requiring different decoders that might not be interruptible.

IIRC, the beep from NSBeep() is actually played by a separate process (SystemUIServer?) This was an optimization added in some earlier OS release to avoid the overhead of initializing CoreAudio and decoding audio files in every app process.

NSSound, on the other hand, does run in your own process, and can definitely block the main thread for macroscopic periods, if that sound hasn’t been played recently.

—Jens

_______________________________________________

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: 
 >NSBeep() blocks for some users (From: George Nachman <email@hidden>)
 >Re: NSBeep() blocks for some users (From: "Glenn L. Austin" <email@hidden>)

  • Prev by Date: Re: Opening a file read-only?
  • Next by Date: Re: core data, binary objects and efficiency
  • Previous by thread: Re: NSBeep() blocks for some users
  • Next by thread: Double-click a main window's title bar to minimize
  • Index(es):
    • Date
    • Thread