ExtAudioFile and 8-bit samples
ExtAudioFile and 8-bit samples
- Subject: ExtAudioFile and 8-bit samples
- From: Kevin Wojniak <email@hidden>
- Date: Tue, 01 Mar 2011 01:10:55 -0800
I've got some raw audio data that is in 8-bit samples. Without knowing any more details about the format (other than sample rate and channel), I threw it into an ExtAudioFile as an AIFF. The output sounded ok right but was very noisy. After googling around I figured out the data was encoded as offset-binary and AIFF expects two's compliment. Applying this conversion before writing the buffer resolved the issue.
I was under the impression ExtAudioFile would do this for me. However, all the various options I tried for mFormatFlags didn't change anything (and none of them seemed to apply, based on their descriptions). Here is what I'm using:
AudioStreamBasicDescription stream = {0};
stream.mSampleRate = 22000;
stream.mFormatID = kAudioFormatLinearPCM;
stream.mFormatFlags = 0;
stream.mBytesPerPacket = 1;
stream.mFramesPerPacket = 1;
stream.mBytesPerFrame = 1;
stream.mChannelsPerFrame = 1;
stream.mBitsPerChannel = 8;
Am I just missing the wrong configuration, or is this encoding not supported?
Thanks,
Kevin
_______________________________________________
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