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

AudioDeviceStart


  • Subject: AudioDeviceStart
  • From: Vincent Predoehl <email@hidden>
  • Date: Mon, 25 Jun 2001 13:15:43 -0400

Hello, I have added property listeners to my application to listen for the kAudioDevicePropertyDeviceIsRunning property. After receiving notification that the device has stopped. My application can almost immediately turn around and ask it to start playing the next phrase.

I still get the kAudioHardwareIllegalOperationError when I do this, even though the listener has been fired with the property change. If I enter a loop and poll the value of kAudioDevicePropertyDeviceIsRunning, and exit the loop after it returns false, everything works fine. I would much use the listeners, but I can't get them to work.

I am using this thread function for the run loop. I suspect I may be doing something wrong here. Can anyone help me get this to work? Thanks.

void* DoThread(void *argToThreadFunct)
{
CFRunLoopRef loop = CFRunLoopGetCurrent();

// tell the HAL to use this run loop
UInt32 theSize = sizeof(CFRunLoopRef);
OSStatus err = AudioHardwareSetProperty(kAudioHardwarePropertyRunLoop, theSize, &loop);
if(err) { cerr << "C++ Exception in " << __FILE__ << ", Line " << __LINE__ << endl; throw err; }

// loop until we're done
while(true)
{
CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeout, false);
pthread_testcancel(); // create a cancellation point, so the thread can be stopped
}

return 0;
}

--
Vincent


  • Prev by Date: Re: Attaching audio driver to another driver.
  • Next by Date: Re: Attaching audio driver to another driver.
  • Previous by thread: Re: [mac-sound-dev] Audio capture using java JMF or CoreAudio or QuickTime on OS X
  • Next by thread: AudioDeviceStart after device stop notification
  • Index(es):
    • Date
    • Thread