问题
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