• 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 after device stop notification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioDeviceStart after device stop notification


  • Subject: AudioDeviceStart after device stop notification
  • From: Vincent Predoehl <email@hidden>
  • Date: Mon, 25 Jun 2001 14:36:57 -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: Converting from INT to Float samples
  • Previous by thread: AudioDeviceStart
  • Next by thread: Re: MIDI device "driver" how-to?
  • Index(es):
    • Date
    • Thread