• 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
Re: New Sample: ExtAudioFile/Recording
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New Sample: ExtAudioFile/Recording


  • Subject: Re: New Sample: ExtAudioFile/Recording
  • From: Kevin Avila <email@hidden>
  • Date: Sat, 22 Jul 2006 11:01:15 -0700

tahome,

	The format flags in your ASBD are invalid. Give this a try:

theFormat.mFormatFlags = kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;

...also don't forget to change the file type parameter of ExtAudioFileCreateNew to kAudioFileAIFFType

Kevin Avila
DTS Audio Engineer
World Wide Developer Relations
Apple Computer, Inc.



On Jul 22, 2006, at 3:32 AM, tahome izwah wrote:

Hi Doug,

please s.b.

2006/7/21, Doug Wyatt <email@hidden>:

On Jul 20, 2006, at 22:43 , tahome izwah wrote:
> [Session started at 2006-07-21 07:28:53 +0200.]
> ExtAudioFileCreateNew FAILED! 1718449215 'fmt?'
> Recording stoped.
>
> I'm certain that I am missing something related to the corresponding
> AudioStreamBasicDescription but I don't know where to look, can you
> help?


The data format you're supplying for the file is incompatible with
the file format.  For WAVE you probably want a little-endian 8, 16,
or 24-bit linear PCM format.

I tried to set this in order to write out an AIFF file but it still doesn't work. If I fill in the AudioStreamBasicDescription as follows

	theFormat.mChannelsPerFrame	= 2;
	theFormat.mSampleRate			= 44100.0;
	theFormat.mFormatID			= kAudioFormatLinearPCM;
	theFormat.mFormatFlags			= kLinearPCMFormatFlagsAreAllClear |
kAudioFormatFlagIsPacked | kAudioFormatFlagIsBigEndian;
	theFormat.mBitsPerChannel		= sizeof(short int) * 8;
	theFormat.mBytesPerFrame		= theFormat.mChannelsPerFrame *
theFormat.mBitsPerChannel / 8;
	theFormat.mFramesPerPacket		= 1;
	theFormat.mBytesPerPacket		= theFormat.mBytesPerFrame *
theFormat.mFramesPerPacket;

then the call to ExtAudioFileCreateNew succeeds but then
ExtAudioFileSetProperty in DCAudioFileRecorder::ConfigureOutputFile
fails. I am using the code without change, except for trying AIFF
instead of MP4 AAC.

I don't get it... how do I have to fill in the
AudioStreamBasicDescription to write a 16bit integer AIFF file, 2
channels @ 44.1kHz?? Could you let us know what I have to change to
write AIFF instead of MP4?

See my earlier message today for examples of how to determine the
compatible data formats for a given file format.

I will but that's a lot of stuff to take in... more than I really wanted to know ;-)

I was previously using Stefan Bernsee's miniAIFF library
(http://www.dspdimension.com) for reading/writing audio files which is
great and works like a charm, but I'd like to support more audio
formats than just AIFF.

Thanks again
--tahome
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com


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
  • Follow-Ups:
    • Re: New Sample: ExtAudioFile/Recording
      • From: "tahome izwah" <email@hidden>
    • Re: New Sample: ExtAudioFile/Recording
      • From: "tahome izwah" <email@hidden>
References: 
 >New Sample: ExtAudioFile/Recording (From: Kevin Avila <email@hidden>)
 >Re: New Sample: ExtAudioFile/Recording (From: "tahome izwah" <email@hidden>)
 >Re: New Sample: ExtAudioFile/Recording (From: Doug Wyatt <email@hidden>)
 >Re: New Sample: ExtAudioFile/Recording (From: "tahome izwah" <email@hidden>)

  • Prev by Date: Re: New Sample: ExtAudioFile/Recording
  • Next by Date: Re: Audio data format and file type - how to match?
  • Previous by thread: Re: New Sample: ExtAudioFile/Recording
  • Next by thread: Re: New Sample: ExtAudioFile/Recording
  • Index(es):
    • Date
    • Thread