When reading audio file with ExtAudioFile read, is it possible to read audio floats not consecutively?

亡梦爱人 提交于 2019-12-02 01:29:08

问题


I`m trying to draw waveform out of mp3 file.

I've succeeded to extract floats using ExtAudioFileReadTest app provided in the Core Audio SDK documentation(link: http://stephan.bernsee.com/ExtAudioFileReadTest.zip), but it reads floats consecutively.

The problem is, that my audio file is very long (about 1 hour), so if I read floats consecutively, it takes so much time.

Is it possible to skip the audio file, then read small partial of audio, then skip and read?


回答1:


Yes, use ExtAudioFileSeek() to seek to the desired sample frame. It has some bugs depending on what format you're using (or did on 10.6) but MP3 should be OK.



来源:https://stackoverflow.com/questions/6902730/when-reading-audio-file-with-extaudiofile-read-is-it-possible-to-read-audio-flo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!