Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
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



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 -----
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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.