Re: Not sure why ExtAudioFileCreateWithURL generates error -66672
Re: Not sure why ExtAudioFileCreateWithURL generates error -66672
- Subject: Re: Not sure why ExtAudioFileCreateWithURL generates error -66672
- From: Anders Norlander <email@hidden>
- Date: Fri, 19 Nov 2010 18:20:42 +0100
You're probably not doing anything wrong, there just is no codec for encoding into AAC format.
You can use AudioFormatGetPropertyInfo(kAudioFormatProperty_EncodeFormatIDs, ...) to get a list
of supported formats.
-Anders
On 2010-11-19, at 2:57 , Eric Chamberlain wrote:
> Hello,
>
> I'm trying to use DoConvertFile() from iPhoneExtAudioFileConvertTest to convert a lpcm file into a m4a aac file. I record the file using AVAudioRecorder, with the following settings:
>
> Float64 sampleRate;
> UInt32 size = sizeof(sampleRate);
> OSStatus err = AudioSessionGetProperty (kAudioSessionProperty_CurrentHardwareSampleRate,
> &size, &sampleRate);
> #pragma unused(err)
>
> NSDictionary *recordSettings = [[NSDictionary alloc] initWithObjectsAndKeys:
> [NSNumber numberWithFloat: sampleRate],AVSampleRateKey,
> [NSNumber numberWithInt: kAudioFormatLinearPCM], AVFormatIDKey,
> [NSNumber numberWithInt: 1], AVNumberOfChannelsKey,
> [NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey,
> nil];
>
> I call DoConvertFile with:
>
> #define RFAudioSampleRate 8000.0
>
> self.outputFormat = kAudioFormatMPEG4AAC;
>
> OSStatus error = DoConvertFile((CFURLRef)[NSURL fileURLWithPath:message.filePath isDirectory:NO],
> (CFURLRef)destinationURL,
> self.outputFormat,
> RFAudioSampleRate);
>
>
> The conversion fails with the following log entries:
>
> AVAudioSession:
> Category: AVAudioSessionCategoryPlayAndRecord
> Route: SpeakerAndMicrophone
>
> DoConvertFile
> Source file format: AudioStreamBasicDescription: 1 ch, 44100 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer
> Destination file format: AudioStreamBasicDescription: 1 ch, 8000 Hz, 'aac ' (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
> Error: couldn't set destination client format (-66672)
>
>
> Any idea what I am doing wrong?
>
>
> --
> Eric Chamberlain
>
>
>
>
>
>
> _______________________________________________
> 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
_______________________________________________
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