simple microphone input with MTCoreAudio
simple microphone input with MTCoreAudio
- Subject: simple microphone input with MTCoreAudio
- From: Nate <email@hidden>
- Date: Fri, 7 Nov 2008 04:33:40 -0800
Here is what I would like to accomplish:
* Retrieve a list of all microphones that support PCM at a 22050 or 44100 sampling rate.
* Open one of those microphones.
* Poll the microphone to retrieve the last 1024 samples.
Poking around, it seems MTCoreAudio might be easier than using CoreAudio itself. There seems to be little documentation aimed at programmers new to CoreAudio, so I'm not sure exactly how to approach the problem. I have played with MTCoreAudio a bit. Is the following the right approach?
* Enumerate the MTCoreAudioDevices, ignoring those that have 0 channels for the "record direction".
* Enumerate the record direction MTCoreAudioStreams for each device.
* Enumerate the logical MTCoreAudioStreamDescriptions for each stream.
* If I find a stream description with a sample rate of 22050 or 44100, then I know I am interested in this microphone.
I have this code working, but I'm not sure where to go from here. I have the device, stream, and stream description I want to open. How do I set the buffer size to 1024 samples? How do I tell the device to use the stream and stream description? I assume once I do those things I call setIOProc and deviceStart, then my IO function gets called when new data arrives?
I should mention, I will be needing to open 4+ different microphones at the same time. Does this impact any of the above?
Thanks!
-Nate
_______________________________________________
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