• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Not sure why ExtAudioFileCreateWithURL generates error -66672
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Not sure why ExtAudioFileCreateWithURL generates error -66672


  • Subject: Not sure why ExtAudioFileCreateWithURL generates error -66672
  • From: Eric Chamberlain <email@hidden>
  • Date: Thu, 18 Nov 2010 17:57:24 -0800

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

  • Follow-Ups:
    • Re: Not sure why ExtAudioFileCreateWithURL generates error -66672
      • From: Anders Norlander <email@hidden>
  • Prev by Date: DLS synth and iOS 4.2
  • Next by Date: Re: Not sure why ExtAudioFileCreateWithURL generates error -66672
  • Previous by thread: Re: DLS synth and iOS 4.2
  • Next by thread: Re: Not sure why ExtAudioFileCreateWithURL generates error -66672
  • Index(es):
    • Date
    • Thread