Re: Combining AUHAL input and an AudioConverter
Re: Combining AUHAL input and an AudioConverter
- Subject: Re: Combining AUHAL input and an AudioConverter
- From: William Stewart <email@hidden>
- Date: Mon, 9 May 2005 10:44:18 -0700
On 06/05/2005, at 9:27 PM, Heath Raftery wrote:
Hello there,
I've been trying for some time to allow sound input and compression
in my app. So far I've struggled through the process of getting
sound in - that appears to be working well now. I'm now stuck
getting the input to feed into the converter for compression.
Here's what I have:
<CODE>
//connect to input device
...
//connect to input converter
AudioStreamBasicDescription asbdIn, asbdOut;
theStatus = AudioUnitGetProperty(*fInputUnit,
kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &asbdIn,
&theSize);
memset(&asbdOut, 0, sizeof(asbdOut));
asbdOut.mFormatID = kAudioFormatQUALCOMM;
asbdOut.mBytesPerFrame = asbdIn.mBytesPerFrame;
asbdOut.mBytesPerPacket = asbdIn.mBytesPerPacket;
asbdOut.mChannelsPerFrame = asbdIn.mChannelsPerFrame;
//I was hoping this would fill in some details of the QUALCOMM
format, but alas, it does nothing despite trying many alternatives
It does
theStatus = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
theSize, &asbdOut, &theSize, &asbdOut);
//so instead I fill it out manually...
This is wrong = all of these fields are describing Linear PCM
asbdOut.mBitsPerChannel = 32;
asbdOut.mBytesPerFrame = 4;
asbdOut.mBytesPerPacket = 4;
asbdOut.mChannelsPerFrame = 1;
asbdOut.mFormatFlags = asbdIn.mFormatFlags;
asbdOut.mFormatID = kAudioFormatQUALCOMM;
now you're saying its qualcomm
asbdOut.mFramesPerPacket = 1;
it ISN'T one frame per packet
asbdOut.mSampleRate = 512; //compression?
sample rate - all audio has a sample rate...
What does the ASBD look like after you make the call to
AudioFormatGetProperty?
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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