Re: PlaySound
Re: PlaySound
- Subject: Re: PlaySound
- From: Esteban Uribe <email@hidden>
- Date: Tue, 08 Apr 2003 15:55:09 -0700
Hi,
On Tuesday, April 08, 2003, at 06:31AM, Lorenzo <email@hidden> wrote:
>
Hi,
>
I would like to play a sound at each step of my loop
>
waiting the sound ends before going to the next step.
>
But I can't. Can you help me?
>
>
long junk;
>
glassSound = [NSSound soundNamed:@"Glass"];
>
>
for(i = 0; i < guess; i++){
>
[glassSound play];
>
Delay(30, &junk);
>
}
>
In order to play the next sound after the first has finished you need to set a
delegate of NSSound, and have the delegate respond to
- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool
Then you can call [glassSound play]; within
- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool
-Esteban
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.