Re: ExtAudioFileCreate / Write conversion question on iOS 3.1.3
Re: ExtAudioFileCreate / Write conversion question on iOS 3.1.3
- Subject: Re: ExtAudioFileCreate / Write conversion question on iOS 3.1.3
- From: Frank Mantek <email@hidden>
- Date: Fri, 11 Feb 2011 08:23:48 +0100
To answer my own question for further reference:
If there is no hardware encoder for AAC, like in the iphone2g, you need to go with Linear PCM. There is no software encoder alternative, as long as you don't roll your own.
The reason extAudioFileCreate failed for me before with format error was that the AudioStreamDescription structure needs to be filled out completely, where in the case that you use an encoder, this is not true. So i missed some bits to be set.
Fixing those little things makes the code work fine, although creating a slightly larger file, on that ancient beauty.
The main thing helping me understand this was the old iphoneExtAudioFileConvertTest sample application. Changing it to run on the iphone2g was key for me to figure this out.
Frank
On Feb 9, 2011, at 7:32 PM, Frank Mantek wrote:
> I have code that runs just fine on the newer SDKs now that produces a nice little mp4 file. Running this on the original iphone 2g though fails.
>
> Originally I thought i create an kAudioFormatMPEG4AAC audiodescription, with the mainformat as a flag, and put this in a kAudioFileMPEG4Type container.
>
> The incoming client data is the linear PCM in stereo.
>
> Using ExtAudioFileWrite works fine on iOS4 etc. But on 3.1.3 it fails with a format error, so some searching later i figure that there is probably no converter available on the iOS3.1.3 version.
>
> So I enumerate the available formats:
>
> 2011-02-09 19:28:51.655 BeatFactor[1233:5f27] -[SoundResourceManager startRecording]:format : 1634492791 - A-Law 2:1
> 2011-02-09 19:28:51.684 BeatFactor[1233:5f27] -[SoundResourceManager startRecording]:format : 1768710755 - ACILBCDecoder-'ilbc'
> 2011-02-09 19:28:51.712 BeatFactor[1233:5f27] -[SoundResourceManager startRecording]:format : 1768775988 - IMA 4:1
> 2011-02-09 19:28:51.745 BeatFactor[1233:5f27] -[SoundResourceManager startRecording]:format : 1819304813 - Linear PCM
> 2011-02-09 19:28:51.775 BeatFactor[1233:5f27] -[SoundResourceManager startRecording]:format : 1970037111 - μ-Law 2:1
>
> those are the 5 i find. But, using them in the ExtAudioCreateFile call fails with a format error in that call (ok, i tried IMA4.1 and Linear PCM).
>
>
> Can someone shed some light no this? Is there a list/blog/webpage that lists formats that work on this ancient platform?
>
> Tia
>
> Frank
_______________________________________________
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