ID3_Tag::Link() takes a long time for WAV files. I'm just using this code, the 1.68 MB 10 second silent WAV file in the attached ZIP and id3lib from id3lib-3.8.3binaries.zip:
#define ID3LIB_LINKOPTION 3 #include <id3/tag.h> int main(int argc, char* argv[]) { ID3_Tag myTag; myTag.Link("d:\\10s_silence.wav"); return 0; }
There is no tag in the WAV file and I have no interest in working with WAV tags. I ran into this bug while trying to play a WAV file in Winamp. The Toaster plugin uses id3lib and runs into this problem.
The time is being spent in void src/tag_parse.cpp in ID3_TagImpl::ParseReader(ID3_Reader &reader), in the following loop. It reads the file character by character looking for a possible MPEG sync byte. This problem should not occur if the WAV file has some 0xFF bytes early on.