• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ExtAudioFile and 8-bit samples
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ExtAudioFile and 8-bit samples


  • Subject: Re: ExtAudioFile and 8-bit samples
  • From: tahome izwah <email@hidden>
  • Date: Tue, 01 Mar 2011 13:36:39 +0100

Contrary to higher word lengths, 8 bit sample frames in an AIFF are
unsigned by default, not sure why ExtAudioFile doesn't respect that.
I'm not sure if there's a combination of mFormatFlags to make it work.

I am using miniAIFF for reading/writing audio files as it has the
added benefit of being cross platform so I never encountered the
problem in my code.

HTH
--th

2011/3/1 Kevin Wojniak <email@hidden>:
> 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

References: 
 >ExtAudioFile and 8-bit samples (From: Kevin Wojniak <email@hidden>)

  • Prev by Date: ExtAudioFile and 8-bit samples
  • Next by Date: Re: ExtAudioFile and 8-bit samples
  • Previous by thread: ExtAudioFile and 8-bit samples
  • Next by thread: Re: ExtAudioFile and 8-bit samples
  • Index(es):
    • Date
    • Thread