Re: Cocoa Sounds
Re: Cocoa Sounds
- Subject: Re: Cocoa Sounds
- From: Damien Cooke <email@hidden>
- Date: Tue, 10 Nov 2009 15:07:27 +1030
Hi all,
I may be way off but in my iPhone game I used SystemSoundID and
AudioServicesCreateSystemSoundID I am not sure if that is helpful at
all but it did not seem to have a delay but it does not support many
formats either. So if you are happy to convert your format this may
be an option?
it looks like this
SystemSoundID wrongLetter;
AudioServicesCreateSystemSoundID((CFURLRef) [[NSURL alloc]
initFileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"wrongLetter" ofType:@"aiff"]], &wrongLetter);
AudioServicesPlaySystemSound(wrongLetter);
//when finished
AudioServicesDisposeSystemSoundID(wrongLetter);
Regards
Damien
On 10/11/2009, at 12:27 PM, Matt Neuburg wrote:
On Mon, 9 Nov 2009 14:16:14 -0500, "Sean McBride" <email@hidden
>
said:
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.
Correct. I'm already doing various dances to try to "prime the pump"
for my
own NSSounds, but I have not found a way to "prime the pump" for an
ordinary
NSBeep. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
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
_______________________________________________
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