• 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
Almost there with ExtAudioFile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Almost there with ExtAudioFile


  • Subject: Almost there with ExtAudioFile
  • From: Fernando Valente <email@hidden>
  • Date: Tue, 3 Aug 2010 17:11:33 -0300

'm almost there with ExtAudioFile. Recording on my app is almost working. There are 2 things I'm still not able do. First is to set the kExtAudioFileProperty_FileDataFormat. I keep getting the -1 error. The second problem is that I don't know what to enter as values for inNumberFrames and ioData in ExtAudioFileWriteAsync.  This is my code:

url = (CFURLRef)[NSURL URLWithString:documents];

	CAStreamBasicDescription clientFormat, dstFormat;
	clientFormat.SetCanonical(1, true);
	clientFormat.mSampleRate = 44100.0;

	printf("Source file format: ");
	clientFormat.Print();
	OSStatus status;
	destinationFile = NULL;

	dstFormat.mFormatID =  kAudioFormatAppleIMA4;
	dstFormat.mSampleRate = 44100.0;
	dstFormat.mChannelsPerFrame = 1;

	UInt32 size = sizeof(dstFormat);
	status = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, NULL, &size, &dstFormat);
	NSLog(@"%d", status);
	printf("Destination file format: ");
	dstFormat.Print();

	status = ExtAudioFileCreateWithURL(url, kAudioFileCAFType, &dstFormat, NULL, kAudioFileFlags_EraseFile, &destinationFile);
	NSLog(@"%d", status);

	size = sizeof(clientFormat);
	status = ExtAudioFileSetProperty(destinationFile, kExtAudioFileProperty_ClientDataFormat, size, &clientFormat);
	NSLog(@"%d", status);

	status = ExtAudioFileSetProperty(destinationFile, kExtAudioFileProperty_FileDataFormat, size, &clientFormat);
	NSLog(@"%d", status);


Fernando Valente
Chiaro Software
email@hidden
http://www.chiarosoft.com
http://www.twitter.com/chiarosoftware

 _______________________________________________
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: Almost there with ExtAudioFile
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: Syncing AudioReflectorDriver to another audio device
  • Next by Date: RE: ExtAudioFileRead
  • Previous by thread: Re: Syncing AudioReflectorDriver to another audio device
  • Next by thread: Re: Almost there with ExtAudioFile
  • Index(es):
    • Date
    • Thread