Re: Reading packets from an audio file
Re: Reading packets from an audio file
- Subject: Re: Reading packets from an audio file
- From: William Stewart <email@hidden>
- Date: Thu, 19 Feb 2009 20:30:25 -0800
We use this code all the time and it works just fine - read the entire
file into memory:
result = AudioFileGetProperty ( fileID,
kAudioFilePropertyAudioDataByteCount, &dataSize, &fileSize);
// file size is the size of the audio data in the file
result = AudioFileGetProperty ( fileID,
kAudioFilePropertyAudioDataPacketCount, &dataSize, &totalPacketCount);
mData is allocated to fileSize bytes
mPacketTable is allocated to totalPacketCount num packet descriptions
// get the data
result = AudioFileReadPackets (fileID, false, &dataSize,
mPacketTable, 0, & totalPacketCount, mData);
Of course you wouldn't normally do this as files are generally too
big, but you get the picture
Bill
On Feb 19, 2009, at 8:11 PM, rethish wrote:
hai,
when I use the functions,
AudioFileGetProperty(audioFileID,
kAudioFilePropertyAudioDataPacketCount, &ioDataSize,
&outPropertyData); and
AudioFileReadPackets(audioFileID, false,
&numByte, buffer->mPacketDescriptions,
startingPacketNumber,
&numPacket, buffer->mAudioData);
I get different value when compared to the real packet number of
the audiofile.
I work with .caf files .
and I am also little bit confused with “ ioDataSize “ , the third
argument of the AudioFileGetProperty();
function.
thank you.
_______________________________________________
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
_______________________________________________
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