Re: Question on ExtAudioFileRead and AudioBuffer for iPhone SDK
Re: Question on ExtAudioFileRead and AudioBuffer for iPhone SDK
- Subject: Re: Question on ExtAudioFileRead and AudioBuffer for iPhone SDK
- From: Douglas Scott <email@hidden>
- Date: Tue, 15 Jun 2010 14:43:32 -0700
Audio files can contain audio samples in a variety of formats. The specific type for any given file can be retrieved by calling ExtAudioFileGetProperty() with the kExtAudioFileProperty_FileDataFormat property which will fill out out an AudioStreamBasicDescription struct with the information you need. You can also ask for the data in a format that is different than what is contained in the file and the ExtAudioFileRead call will convert the data for you (look for the client data format property). Then you can cast the void * pointer to whatever type you have asked for.
-DS
On Jun 15, 2010, at 1:11 PM, Calvin Xia wrote:
> I'm new to iPhone development and am developing an iPhone app that uses the Extended Audio File Services. I try to use ExtAudioFileRead to read the audio file, and store the data in an AudioBufferList structure.
>
> AudioBufferList is defined as:
>
> struct AudioBufferList {
> UInt32 mNumberBuffers;
> AudioBuffer mBuffers[1];
> };
> typedef struct AudioBufferList AudioBufferList;
> and AudioBuffer is defined as
>
> struct AudioBuffer {
> UInt32 mNumberChannels;
> UInt32 mDataByteSize;
> void* mData;
> };
> typedef struct AudioBuffer AudioBuffer;
>
> I want to manipulate the mData but I wonder what does the void* mean. Why is it void*? How can I decide what data type is actually stored in mData? _______________________________________________
_______________________________________________
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