(Objective C) Just using simple AudioServicesPlaySystemSoundID and its counterparts, but I can't find in the documentation if there is already a way to find the length of an audio file.
I know there is AudioServicesGetPropertyInfo, but that seems to return a byte-buffer - do audio files embed their length in themselves and I can just extract it with this?
Or is there perhaps a formula based on bit-rate * fileSize to convert to length-of-time?
mIL3S
www.milkdrinkingcow.com
See at:
see ADC sample at: http://developer.apple.com/library/mac/#samplecode/PlayFile/Introduction/Intro.html
without using AVPlayer...
According to a quick Google search, there is a formula:
Is there any particular reason you're using System Sound Services to play a sound?
If you use AVAudioPlayer to handle your sounds you could do something like:
sample code from answer How to get the duration of an audio file in iOS?. This is the best answer.