Re: iSight audio format for converter
Re: iSight audio format for converter
- Subject: Re: iSight audio format for converter
- From: Jeff Moore <email@hidden>
- Date: Thu, 28 Oct 2004 13:25:52 -0700
What you have there isn't going to work since, generally speaking,
audio devices vend their data as Float32's, not to mention the fact
that the iSight is mono.
Your best bet is to use the HAL (or AUHAL if you are using it) to ask
the device for it's format and passing that to the AudioConverter. That
way you won't have to guess.
On Oct 28, 2004, at 12:57 PM, Eric Olson wrote:
Hello,
Can anyone help verify the format coming from an iSight audio device
that
can be passed to an AudioConverter?
I'm fairly new to this, but I've successfully used an AudioConverter
with a different source, and I'm getting mostly loud noise (with faint
speech) out of my converter for the iSight.
Below is the format description I'm trying with the iSight and a
description of the format I'm converting to. The iSight documentation
says it has stereo data, but I'm not sure if it's combined into mono
data
before I receive it.
Also, I'm using AudioDeviceAddIOProc() with an io callback to get the
data.
Here is the iSight format I'm trying:
AudioStreamBasicDescription iSightDesc;
iSightDesc.mSampleRate = 48000;
iSightDesc.mFormatID = kAudioFormatLinearPCM ;
iSightDesc.mFormatFlags = kLinearPCMFormatFlagIsBigEndian |
kAudioFormatFlagIsSignedInteger;
iSightDesc.mBitsPerChannel = 16;
iSightDesc.mFramesPerPacket = 1;
iSightDesc.mChannelsPerFrame = 2;
int interleaved = 1;
if (interleaved)
iSightDesc.mBytesPerPacket = iSightDesc.mBytesPerFrame =
iSightDesc.mChannelsPerFrame * sizeof(short);
else {
iSightDesc.mBytesPerPacket = iSightDesc.mBytesPerFrame =
sizeof(short);
iSightDesc.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
}
and here is the destination format (that has worked before):
AudioStreamBasicDescription l16MonoDesc;
l16MonoDesc.mSampleRate = 16000;
l16MonoDesc.mFormatID = kAudioFormatLinearPCM;
l16MonoDesc.mFormatFlags = kAudioFormatFlagIsSignedInteger |
kLinearPCMFormatFlagIsBigEndian;
l16MonoDesc.mFramesPerPacket = 1;
int numChannels = 1;
l16MonoDesc.mBytesPerPacket = l16MonoDesc.mBytesPerFrame = numChannels
* sizeof(short);
l16MonoDesc.mChannelsPerFrame = 1;
l16MonoDesc.mBitsPerChannel = 16;
Any suggestions or comments are welcome,
Eric
Eric Olson
email@hidden
Futures Lab, MCS, Argonne National Labs
_______________________________________________
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
--
Jeff Moore
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