How to calculate the audio file duration in core audio?

Posted by mystify on Stack Overflow See other posts from Stack Overflow or by mystify
Published on 2010-05-06T14:46:00Z Indexed on 2010/05/06 14:48 UTC
Read the original article Hit count: 221

Filed under:
|
|

I have this info variable which is of this type:

struct AudioStreamBasicDescription {
    Float64 mSampleRate;
    UInt32  mFormatID;
    UInt32  mFormatFlags;
    UInt32  mBytesPerPacket;
    UInt32  mFramesPerPacket;
    UInt32  mBytesPerFrame;
    UInt32  mChannelsPerFrame;
    UInt32  mBitsPerChannel;
    UInt32  mReserved;
};

How could I calculate the total duration of the audio file, in seconds?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about core