Re: Reading packets from an audio file
Re: Reading packets from an audio file
- Subject: Re: Reading packets from an audio file
- From: rethish <email@hidden>
- Date: Thu, 26 Feb 2009 10:14:54 +0530
- Thread-topic: Reading packets from an audio file
Hai ,
Thank You for the response,
It really works.
Expecting more help in future.
Thank you
On 2/25/09 10:47 PM, "Stephen Davis" <email@hidden> wrote:
> kAudioFilePropertyAudioDataPacketCount returns a UInt64 so
> outPropertyData needs to be a UInt64, not a UInt32.
>
> stephen
>
> On Feb 25, 2009, at 4:01 AM, rethish wrote:
>
>>
>> Hai,
>>
>> Thank you for your reply
>> Sorry for the late response.
>>
>> I use the same code still I get wrong value.
>>
>> UInt32 outPropertyData;
>>
>> UInt32 ioDataSize=sizeof(outPropertyData);
>>
>> UInt32 result= AudioFileGetProperty(audioFileID,
>> kAudioFilePropertyAudioDataPacketCount,
>> &ioDataSize, &outPropertyData);
>>
>> NSLog(@" out : %u",outPropertyData);
>> NSLog(@" result : %u",result);
>>
>>
>> out : 3221217848
>> result : 561211770
>>
>> When I use other property like kAudioFilePropertyEstimatedDuration, it
>> yields same results
>>
>> Where I got wrong?
>>
>> Is there any mistake in declaring the third and fourth arguments?
>>
>> Thank you in advance
>>
>>
>> On 2/20/09 10:00 AM, "William Stewart" <email@hidden> wrote:
>>
>>> 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
>
> _______________________________________________
> 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