• 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: What is the AudioStreamBasicDescription(asbd) for a wav file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the AudioStreamBasicDescription(asbd) for a wav file


  • Subject: Re: What is the AudioStreamBasicDescription(asbd) for a wav file
  • From: "Paul Sanders" <email@hidden>
  • Date: Fri, 9 Jul 2010 22:58:40 +0100

I think you should be using SInt16 rather than AudioUnitSampleType.  Also, although it doesn't matter if you only ever run on Intel, omit kAudioFormatFlagsNativeEndian.  Little-endian is the default and that's what you want here.
 
Something to get your head around if you are using Extended Audio File Services is that there are two data formats you need to specify.  One is the format of the file you want to create, and that (I assume) is what we're discussing here.  The other is  the 'client data format' which specifies the format of samples you pass to ExtAudioFileWrite.  This, within reason, can be anything you like.  They can of course be the same, and from you're previous post that's probably what you want, but the nice thing is that they don't have to be.
 
HTH.
 
Regards,
 
Paul Sanders.
 
----- Original Message -----
From: Sanoj Nambi
To: Paul Sanders
Cc: tahome izwah ; email@hidden
Sent: Friday, July 09, 2010 9:16 PM
Subject: Re: What is the AudioStreamBasicDescription(asbd) for a wav file

I used 

anASBD.mSampleRate = 44100.0;

anASBD.mFormatID = kAudioFormatLinearPCM;

anASBD.mFormatFlags  = kAudioFormatFlagsAudioUnitCanonical;

anASBD.mBytesPerPacket = sizeof(AudioUnitSampleType)*2;  

anASBD.mFramesPerPacket = 1;

anASBD.mBytesPerFrame = sizeof(AudioUnitSampleType)*2;

anASBD.mChannelsPerFrame = 2;

anASBD.mBitsPerChannel = 8 * sizeof(AudioUnitSampleType);

anASBD.mReserved = 0;

anASBD.mFormatFlags = kAudioFormatFlagIsSignedInteger |

           kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;


and it is creating a wav file.I can also see the size of the file is 5 MB.But I am unable to play.


I dont want to use some other framework unless i have no other option.


Regards,

Nambiar

 _______________________________________________
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

References: 
 >What is the AudioStreamBasicDescription(asbd) for a wav file (From: Sanoj Nambi <email@hidden>)
 >Re: What is the AudioStreamBasicDescription(asbd) for a wav file (From: "Paul Sanders" <email@hidden>)
 >Re: What is the AudioStreamBasicDescription(asbd) for a wav file (From: tahome izwah <email@hidden>)
 >Re: What is the AudioStreamBasicDescription(asbd) for a wav file (From: "Paul Sanders" <email@hidden>)
 >Re: What is the AudioStreamBasicDescription(asbd) for a wav file (From: Sanoj Nambi <email@hidden>)

  • Prev by Date: Re: What is the AudioStreamBasicDescription(asbd) for a wav file
  • Next by Date: Re: AULab crashes during recording
  • Previous by thread: Re: What is the AudioStreamBasicDescription(asbd) for a wav file
  • Next by thread: iPhone Library Access
  • Index(es):
    • Date
    • Thread