开发者

seek in audio file based on time

Seeking through an audio file based on the packet level is simple. One just has to change currentPacket when filling the next buffer:

AudioFileReadPackets(_audioFile, false, &numBytes, _packetDescs, _currentPacket, &numPackets, buffer->mAudioData);

But what if you want to seek to position 10s from the beginning of the file? For the CBR files this should be simple to calcula开发者_如何转开发te - but what about VBR files?


The solution is to use the ExtAudio* API. One can convert the input files to LPCM on the fly and then seeking becomes trivial.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜