• 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
Converting Linear PCM to compressed formats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting Linear PCM to compressed formats


  • Subject: Converting Linear PCM to compressed formats
  • From: Angel Loke <email@hidden>
  • Date: Wed, 25 Feb 2009 22:40:10 +0800

Hi folks,

I'm trying to use AudioConverter to convert a raw audio file into a compressed format. Here are my ASBDs.

in_asbd.mSampleRate           = 44100;
in_asbd.mFormatID             = kAudioFormatLinearPCM;
in_asbd.mFormatFlags          = kAudioFormatFlagIsSignedInteger;
in_asbd.mChannelsPerFrame     = 2; 
in_asbd.mBitsPerChannel       = 16;

etc..

For the out asbd, it's
out_asbd.mSampleRate   = 44100;
out_asbd.mFormatID   = kAudioFormatAppleIMA4;
out_asbd.mFormatFlags   = 0;
out_asbd.mChannelsPerFrame  = 2;
out_asbd.mBitsPerChannel   = 0;
out_asbd.mBytesPerFrame     = (out_asbd.mBitsPerChannel>>3) * out_asbd.mChannelsPerFrame; /
out_asbd.mFramesPerPacket   = 64;
out_asbd.mBytesPerPacket     = 68;


If I convert using
while( err == noErr &&  ioNumberFrames == numPackets )
{
err = AudioConverterFillComplexBuffer(audioConverter, 
InputProc, 
this, 
&ioNumberFrames, 
mOutputBufferList,
NULL);
}

I won't get any errors, but on playing, there won't be any sound. However the media length is correct.

If I just call AudioConverterFillComplexBuffer without the loop, I'll get an insz error as the method is calling my InputProc with a different number of frames.

The thing is though, I have a set amount of data to pass to the AudioConverter at every invocation. Is there anyway to force it to accept this amount of data? And is calling the method from the while loop correct? It runs without any errors but doesn't have any sound at all.

Any pointers regarding this issue will be much appreciated.

\\Angel
 _______________________________________________
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

  • Prev by Date: Getting the PreferedHardwareIOBufferDuration
  • Next by Date: Re: Reading packets from an audio file
  • Previous by thread: Re: Getting the PreferedHardwareIOBufferDuration
  • Next by thread: multiple audio channels represented in a single track
  • Index(es):
    • Date
    • Thread