iSight audio format for converter
iSight audio format for converter
- Subject: iSight audio format for converter
- From: Eric Olson <email@hidden>
- Date: Thu, 28 Oct 2004 14:57:01 -0500 (CDT)
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