RE: can ExtAudio file be used to compress PCM on iPhone
RE: can ExtAudio file be used to compress PCM on iPhone
- Subject: RE: can ExtAudio file be used to compress PCM on iPhone
- From: "Andrew E. Davidson" <email@hidden>
- Date: Fri, 7 Aug 2009 10:56:42 -0700
Hi Bill
I figured out what the bug was
> out.mFormatID = kAudioFormatAppleLossless;
> out.mFormatFlags = in.mFormatFlags;
Setting flags causes a format error. The input flags where
kAudioFormatFlagIsSignedInteger |
> audioFormatFlagIsPacked;
Andy
________________________________
Replace Ads with your Stuff! Learn how @ www.prowebsurfer.com
> -----Original Message-----
> From: coreaudio-api-bounces+andy=email@hidden
> [mailto:coreaudio-api-bounces+andy=email@hidden] On
> Behalf Of Andrew E. Davidson
> Sent: Thursday, August 06, 2009 3:12 PM
> To: 'William Stewart'
> Cc: 'Core Audio Apple'
> Subject: FW: can ExtAudio file be used to compress PCM on iPhone
>
> Hi Bill
>
> Can I Use ExtAudio File to convert PCM into ALAC on iPhone? AAC is not
> supported, and I could never get MP3 to work. Do I need to use some other
> set of APIs to convert?
>
> I used /usr/bin/afinfo to figure out what format Voice Memos uses when
> sending audio files using in app email. The file type is id is m4af. The
> file itself is named memo.m4a.
>
> Here is my input format
> in.mSampleRate = self.hardwareSampleRate / 4.0;
> in.mFormatID = kAudioFormatLinearPCM;
> in.mChannelsPerFrame = 1;
> in.mFormatFlags = kAudioFormatFlagIsSignedInteger |
> audioFormatFlagIsPacked;
> in.mFramesPerPacket = 1;
> in.mBitsPerChannel = 16;
> in.mBytesPerPacket = 2;
> in.mBytesPerFrame = 2;
>
> Here is my output format
> out.mSampleRate = in.mSampleRate;
> out.mFormatID = kAudioFormatAppleLossless;
> out.mChannelsPerFrame = input.mChannelsPerFrame;
> out.mFormatFlags = in.mFormatFlags;
> out.mFramesPerPacket = 4096;
> out.mBitsPerChannel = 0;
> out.mBytesPerPacket = 0;
> out.mBytesPerFrame = 0;
>
> ExtAudioFileCreateWithURL(outURL, kAudioFileM4AType,
)
>
> I get a 1718449215 error when I try to set the client data
> ExtAudioFileSetProperty(outputFile,
> kExtAudioFileProperty_ClientDataFormat,
> size, &inputFormat);
>
>
> Any idea what I am doing wrong? How should mFormatID and
> ExtAudioFileCreateWithURL type argument be set? They do not use the same
> enumeration.
>
> I have a sneaking suspicion that ExtAudioFile services do not support
> compression in OS 3.0
>
> thanks
>
> Andy
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> api/email@hidden
>
> 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