Re: Cocoa Sounds
Re: Cocoa Sounds
- Subject: Re: Cocoa Sounds
- From: James Walker <email@hidden>
- Date: Tue, 10 Nov 2009 10:26:14 -0800
Damien Cooke wrote:
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);
On the Mac, this way of playing a sound will respect the "play user
interface sound effects" checkbox in the Sound preference panel, unless
you make an AudioServicesSetProperty call to change that. I think.
--
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