Loading Audio File into Array
Loading Audio File into Array
- Subject: Loading Audio File into Array
- From: Jannik <email@hidden>
- Date: Tue, 24 Jan 2006 22:58:41 +0000
Hello list. I have a couple of questions regarding audio files. What
I want to do is load an entire audio file into an array, which will
be pointed to by an AudioBufferList.mBuffers[0].mData pointer. I
already know the format more or less (stereo, 48 KHz, 24 bit, and the
length will never be longer than 10 seconds). My questions are:
1. How do I determine what size the array containing the audio file
should be initialized as? I am thinking I have to call
ExtAudioFileGetProperty() with the constant of
kExtAudioFileProperty_FileLengthFrames, which returns the number of
frames of the input file as an SInt64. Then I will declare the array
to be the size of the value which ExtAudioFileGetProperty returned.
2. What is the appropriate way to load the entire file into the
array? I have seen AudioFileReadBytes() used in previous, old (OS X
10.2) emails to the mailing list, and ExtAudioFileRead used in the
ConvertFile sample project. However, both of these take a UInt32, and
I have an SInt64 from the ExtAudioFileGetProperty(). This makes me
wonder if my assumptions are correct.
Thank you for any help.
Jannik
_______________________________________________
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