Re: Cocoa Sounds
Re: Cocoa Sounds
- Subject: Re: Cocoa Sounds
- From: "Sean McBride" <email@hidden>
- Date: Mon, 9 Nov 2009 14:16:14 -0500
- Organization: Rogue Research Inc.
On 11/9/09 10:50 AM, Jens Alfke said:
>I ran into this too. A decent workaround is to preload the sound:
>create an NSSound object for the audio file you want to play, set its
>volume to zero, then play it. After that it's "warmed up" and will
>play instantly.
I just tried this, and it seems to work well. One catch is that 'play'
is asynchronous, so you have to restore the volume to non-0 in the
sound:didFinishPlaying: delegate callback.
Altogether quite annoying.
And this won't help fix the same problem with NSBeep.
>(Actually not entirely instantly on laptops, which will turn off the
>audio hardware when it hasn't been used in a few minutes, to save
>battery power. Turning it back on delays the sound a fraction of a
>second and creates a slight 'pop'.)
Ugh.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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