Re: Getting 'fmt?' error returns from AudioConverterNew ()
Re: Getting 'fmt?' error returns from AudioConverterNew ()
- Subject: Re: Getting 'fmt?' error returns from AudioConverterNew ()
- From: "Kyle Sluder" <email@hidden>
- Date: Mon, 5 Nov 2007 14:43:42 +0000
You're setting mFormatID to "aac " instead of 'aac '? It compiles
because sizeof(int) == sizeof(char[4]).
--Kyle Sluder
On 11/5/07, Daniel Stenning <email@hidden> wrote:
> I am experimenting with using the CoreAudio audio converter to convert an
> aac stream to PCM. With the following settings I am getting 'fmt?' return
> errors.
>
>
> Anyone know what i'm doing wrong ?
>
> AudioStreamBasicDescription ASIn;
> AudioStreamBasicDescription ASOut;
>
>
> ASIn.mBitsPerChannel = 0;
> ASIn.mBytesPerFrame = 0;
> ASIn.mBytesPerPacket = 0;
> ASIn.mChannelsPerFrame= 1;
> ASIn.mFormatFlags = kMP4Audio_AAC_LC_ObjectType;
> ASIn.mFormatID = "aac ";
> ASIn.mFramesPerPacket = 1024;
> ASIn.mSampleRate = 44100;
>
> ASOut.mBitsPerChannel = 16;
> ASOut.mBytesPerFrame = 2;
> ASOut.mBytesPerPacket = 1024;
> ASOut.mChannelsPerFrame = 2;
> ASOut.mFormatFlags = 3; // for float, big endian
> ASOut.mFormatID = 'lpcm';
> ASOut.mFramesPerPacket = 512;
> ASOut.mSampleRate = 44100;
>
>
> AudioConverterRef conv;
>
> UInt32 err = AudioConverterNew ( &ASIn, &ASOut, &conv );
>
> Regards,
>
> Dan
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users 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.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden