Re: Does NSSound not work in a Unix tool?
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.