Re: Mixing 16Khz, 8 bit audio
Re: Mixing 16Khz, 8 bit audio
- Subject: Re: Mixing 16Khz, 8 bit audio
- From: Aran Mulholland <email@hidden>
- Date: Wed, 22 Sep 2010 00:53:11 +1000
Excellent stuff,
Between you and Stéphane, I'm totally sorted.
I might mention I also set the
Float64 graphSampleRate = 16000.0;
err = AudioUnitSetProperty (outputMixerUnit,
kAudioUnitProperty_SampleRate,
kAudioUnitScope_Output,
0,
&graphSampleRate,
sizeof (graphSampleRate));
of my mixer to match the input stream of the next one up the line as well.
thanks, all working, lets go 8 bit....
Aran
On Wed, Sep 22, 2010 at 12:30 AM, Stephen F. Booth <email@hidden> wrote:
> It looks like your ASBD might not be correct:
>
>>
>> Just wondering whether it is possible to set up a multi channel mixer
>> on the iPhone to accept a format like this: (its meant to be 16Khz, 8
>> bit, non interleaved stereo)
>>
>> nonInterleavedAudioFormat.mSampleRate = 16000.0;
>> nonInterleavedAudioFormat.mFormatID = kAudioFormatLinearPCM;
>> nonInterleavedAudioFormat.mFormatFlags =
>> kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsNonInterleaved |
>> kAudioFormatFlagIsPacked;
>> nonInterleavedAudioFormat.mFramesPerPacket = 1;
>> nonInterleavedAudioFormat.mChannelsPerFrame = 2;
>> nonInterleavedAudioFormat.mBitsPerChannel = 8;
>> nonInterleavedAudioFormat.mBytesPerPacket = 2;
>> nonInterleavedAudioFormat.mBytesPerFrame = 2;
>
> For 8 bit packed audio, non-interleaved, mFramesPerPacket = mBytesPerPacket
> = mBytesPerFrame = 1.
> The format as you have it now specifies:
> AudioStreamBasicDescription: 2 ch, 16000 Hz, 'lpcm' (0x0000002C) 8-bit
> little-endian signed integer, packed in 2 bytes low-aligned, deinterleaved
>
> Stephen
>
>>
>>
>>
>> When I do a
>>
>> err = AudioUnitSetProperty(outputMixerUnit,
>> kAudioUnitProperty_StreamFormat,
>> kAudioUnitScope_Output,
>> 0,
>> &nonInterleavedAudioFormat,
>> sizeof(nonInterleavedAudioFormat));
>>
>> I get the dreaded -10868 (kAudioUnitErr_FormatNotSupported)
>>
>> It is fine setting the input however :
>>
>> err = AudioUnitSetProperty(outputMixerUnit,
>> kAudioUnitProperty_StreamFormat,
>> kAudioUnitScope_Input,
>> 0,
>> &nonInterleavedAudioFormat,
>> sizeof(nonInterleavedAudioFormat));
>>
>> I'd really like to know what I'm doing wrong, I usually spend more
>> time setting up the AUGraph and connections than coding my Audio.
>>
>> What formats are supported? Setting the RemoteIO's input with the same
>> input is allowed.
>>
>> err = AudioUnitSetProperty(remoteIOUnit,
>> kAudioUnitProperty_StreamFormat,
>> kAudioUnitScope_Input,
>> 0,
>> &nonInterleavedAudioFormat,
>> sizeof(nonInterleavedAudioFormat));
>>
>>
>> Thanks
>>
>> Aran.
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> 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
>
_______________________________________________
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