Re: Recording to AAC format, basic questions
Re: Recording to AAC format, basic questions
- Subject: Re: Recording to AAC format, basic questions
- From: Doug Wyatt <email@hidden>
- Date: Fri, 7 Jul 2006 18:15:46 -0700
On Jul 7, 2006, at 18:02 , Nir Soffer wrote:
I need to record sound from some input device, typically built-in
microphone or other microphone to AAC or QuickTime movie format.
The recording are 60-90 minutes long (people talking), and should
create small files (the recordings are served over the web later).
The file format should be mono, 22KHz, 16Kbs bitrate. I need to
support only Tiger.
After searching and reading the docs and lot of example code, it
seems that the easiest way is to use MTCoreAudio to get the data
from the default input device, and feed the data into ExtAudioFile
using ExtAudioFileWriteAsync.
That's a good basic approach.
How can I produce mono from stereo input I get fron built in Audio?
Does a simple microphone give true stereo output or its actually
the same data duplicated, so I can just use one channel?
There could be a pair of stereo microphones plugged into the mic jack.
I'd suggest that you record from the default stereo pair (if you
don't want to have UI for selecting the input source) and sum the
channels yourself if you want to record mono.
I see that the built in sound provides only 32/44/48KHz - how can I
get 22KHz?
Different hardware will have different available sample rates; you
should be prepared for any source sample rate.
can I down-sample using the AudioConverter owned by the ExtAudioFile?
... but if you're sure you want to produce 22050 Hz, yes, you can set
the sample rate of the AAC data format to 22050 (caveat: not all
combinations of bitrate/sample rate work with the AAC encoder...
others can go into further detail...)
I don't have any idea what sample rate will provide some other
device in the field, e.g. wireless microphone, what is the general
strategy to handle this?
You might just try leaving the sample rate alone and instead just
make sure to set your bit rate to what you want. 16 kbps will most
likely force downsampling anyhow.
When the user change the default device during a recording, I have
to stop the recording and reconfigure using the new default device,
or there is a way to use the current selected default device in a
transparent way?
Just use AUHAL without setting it to any particular device; it will
default to the default input device/data source.
What about changing the data source, for example, selecting line in
instead of digital in - can you continue to record from built-in
audio after the data source was changed?
Using AUHAL, I believe you should be able to continue recording
across one of these transitions without having to do anything
special. You'll almost certainly lose some samples though.
Doug
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
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