AudioQueueGetCurrentTime (mQueue, timeLine, & timeStamp, NULL); to get the current playing time, it gives some great importance, is it really
Probably, but thatโs not what you think. It is not in seconds; the documents do not say what it is, but googling around, apparently, in frames. (For example, this technot contains a fragment that treats it as frames.) Try dividing by the sampling rate and dividing by the (source) frame rate and see which one you get reasonable numbers.
how to get the duration of a music file.
Not. A sound queue is simple: a queue of sound bites to play or record. The only queue length is the number of samples that you could queue; the queue does not know the length of everything that could be absorbed into it, if these sources even have a finite length.
The audio queue calls the function you create to receive audio samples from you. Wherever your function gets samples from (e.g. AudioFile), you need to get the length. If you yourself generate samples (as in a tone or noise generator), then the length, if any, is up to you.
source share