• 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: PlayFile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: PlayFile
      • From: William Stewart <email@hidden>
References: 
 >MTCoreAudio (From: Michael Hanna <email@hidden>)
 >Re: MTCoreAudio (From: William Stewart <email@hidden>)
 >PlayFile [was Re: MTCoreAudio] (From: Michael Hanna <email@hidden>)
 >Re: PlayFile [was Re: MTCoreAudio] (From: William Stewart <email@hidden>)

  • Prev by Date: Re: PlayFile
  • Next by Date: afconvert
  • Previous by thread: Re: PlayFile
  • Next by thread: Re: PlayFile
  • Index(es):
    • Date
    • Thread