FW: can ExtAudio file be used to compress PCM on iPhone
FW: can ExtAudio file be used to compress PCM on iPhone
- Subject: FW: can ExtAudio file be used to compress PCM on iPhone
- From: "Andrew E. Davidson" <email@hidden>
- Date: Thu, 6 Aug 2009 15:12:04 -0700
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:
This email sent to email@hidden