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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to