• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reading packets from an audio file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading packets from an audio file


  • Subject: Re: Reading packets from an audio file
  • From: rethish <email@hidden>
  • Date: Wed, 25 Feb 2009 17:31:31 +0530
  • Thread-topic: Reading packets from an audio file

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

  • Follow-Ups:
    • Re: Reading packets from an audio file
      • From: Stephen Davis <email@hidden>
    • Re: Reading packets from an audio file
      • From: David Duncan <email@hidden>
References: 
 >Re: Reading packets from an audio file (From: William Stewart <email@hidden>)

  • Prev by Date: iPhone switching output
  • Next by Date: Getting the PreferedHardwareIOBufferDuration
  • Previous by thread: Re: Reading packets from an audio file
  • Next by thread: Re: Reading packets from an audio file
  • Index(es):
    • Date
    • Thread