Re: Cocoa Sounds
Re: Cocoa Sounds
- Subject: Re: Cocoa Sounds
- From: Dave DeLong <email@hidden>
- Date: Mon, 09 Nov 2009 11:39:49 -0700
That makes sense, because NSSound has to go find the resource named
"mySound.m4a", load it into memory, and then play it.
Have you tried preloading the sound, so that by the time you want to
play it, it's already in memory?
Dave
On Nov 9, 2009, at 11:37 AM, Chunk 1978 wrote:
i'm using Cocoa's NSSound. here's is how i play sounds:
-=-=-=-=-
if ([[soundRadioGroup cellWithTag:1] state] == NSOnState)
{
NSSound *theSound = [NSSound soundNamed:@"mySound.m4a"];
if ([theSound isPlaying])
[theSound stop];
[theSound play];
}
-=-=-=-=-
the first sound is always lagged. for example, if i press a button
to play
a sound, the button's pressed state will remain until the sound is
loaded
and played. after the first sound plays, all other sounds will play
without
lag.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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