Re: PlayFile
Re: PlayFile
- Subject: Re: PlayFile
- From: Michael Hanna <email@hidden>
- Date: Fri, 9 Dec 2005 23:36:41 -0800
I have a
-(IBAction)playFileNow:(id)sender
which is called from the nsbutton. It essentially does what the main
() function does in PlayFile.cpp. Upon clicking, the file plays but
the app becomes completely unresponsive(spinning pinwheel) until the
file has been fully played. I tried removing the usleep() call but
that seemed ineffective. Is this expected behaviour? How do I make my
app responsive to user interaction while it plays audio?
Michael
On 9-Dec-05, at 12:43 PM, William Stewart wrote:
Cool, I actually made a simple playback cocoa app that wraps the
functions found in PlayFile.cpp.
few things I'd like to know:
- the NSButton stays in the on state. How do I farm-out the
playback task to another thread?
The playback is happening in another thread. Once you start the
graph, playback is taking care of itself:
// start playing
XThrowIfError (AUGraphStart (theGraph), "AUGraphStart");
this is the part where you just return...
we wait in the command line for the file to finish playing
// sleep until the file is finished
usleep ((int)fileDuration * 1000 * 1000);
then we clean up.
// lets clean up
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden