How to get total time duration of music in audioQueue. I am using
NSTimeInterval AQPlayer::getCurrentTime()
{
NSTimeInterval timeInterval =
NSTimeInterval AQPlayer::getTotalDuration()
{
UInt64 nPackets;
UInt32 propsize = sizeof(nPackets);
XThrowIfError (AudioFileGetProperty(mAudioFile, kAudioFilePropertyAudioDataPacketCount, &propsize, &nPackets), "kAudioFilePropertyAudioDataPacketCount");
Float64 fileDuration = (nPackets * mDataFormat.mFramesPerPacket) / mDataFormat.mSampleRate;
return fileDuration;
}