• 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: Does NSSound not work in a Unix tool?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does NSSound not work in a Unix tool?


  • Subject: Re: Does NSSound not work in a Unix tool?
  • From: Andy Lee <email@hidden>
  • Date: Thu, 21 Mar 2002 10:05:52 -0500

At 3:20 PM +0100 3/21/02, Uli Zappe wrote:
[[NSSound soundNamed:@"Submarine"] play];
sleep(3);

works. :-)

Only remaining question: Do you happen to know of a more elegant method than sleep() to wait for the (actual) time when the sound is finished?

In your case, you could use a loop that continually asks whether the sound is playing, by sending an -isPlaying message. In a more general case, you'd probably want to use the delegate method -sound:didFinishPlaying:.

I haven't tried these techniques myself; I'm just going by the info in /Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/Sound/Tasks/PlayingAudioData.html. The docs for NSSound are pretty sketchy, so I can't vouch for their accuracy.

--Andy
_______________________________________________
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.

References: 
 >Re: Does NSSound not work in a Unix tool? (From: Uli Zappe <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 2 #363 - 15 msgs
  • Next by Date: How to send message between thread?
  • Previous by thread: Re: Does NSSound not work in a Unix tool?
  • Next by thread: Re: Does NSSound not work in a Unix tool? - SOLUTION
  • Index(es):
    • Date
    • Thread