tags:

views:

23

answers:

1

How do I determine the length of an audio recording I am recording programaticaly? My current solution is to just time the start/stop recording events on the User Interface (literally the time the user hits record, then hits stop recording.) Given a .aac audio file, is there some library call in Objective-C or Python to determine its length?

A: 

On the iPad:

totalFrames = format->mFramesPerPacket * recordedPackets;
lengthInSeconds = totalFrames / format->mSampleRate
MikeN