• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: PlaySound
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: How-To: private framework
  • Next by Date: Re: Inserting Graphics into NSTextView
  • Previous by thread: -[NSApplication beginModalSessionForWindow:] without showing or repositioning window?
  • Next by thread: Re: PlaySound
  • Index(es):
    • Date
    • Thread