iMic rate change fails at first
iMic rate change fails at first
- Subject: iMic rate change fails at first
- From: "Phil Burk" <email@hidden>
- Date: Wed, 16 Oct 2002 13:11:05 -0700
I am working on the CoreAudio implementation for PortAudio.
I have a test program that tries to record some audio data in half duplex
mode, then plays back the recording. When I test at one sample rate then try
a new sample rate, the program fails the first time it is run. The
AudioDeviceStart() function for the recording phase returns an error code
560226676, which I think is '!dat' or kAudioDeviceUnsupportedFormatError.
When I run the program a second time, it works fine.
I am using an iMic on a Bronze PowerBook with OS X 10.1.3.
Sequence of operations:
set INPUT sample rate
AudioDeviceStart()
AudioDeviceStop()
set OUTPUT sample rate
AudioDeviceStart()
AudioDeviceStop()
I am using rates the iMic supports, ie. 22050, 32000, 44100, 48000.
I thought that perhaps the iMic fails when the input and output rates don't
match. But the output rate is mismatched in the second execution of the test
when it does work!
TEST: I ran at 44100, then tried to run at 43000. It worked the first time!
Probably because the 43000 Hz rate is not supported by the iMic HW for input
so it was still actually running at 44100 Hz.
TEST: I modified my program to immediately call AudioDeviceStart() again if
it fails the first time. The second time AudioDeviceStart() did not return
an error but my callback was never called.
So it appears that if a program changes the input sample rate of the iMic
from its current setting then it will fail the first time and succeed the
second time.
Is this a known bug?
Any workarounds?
Would you like source code?
Phil Burk
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.