Version: 1.6.3 (using Devel) OS: MS Windows A user of my WMP Tag Plus plug-in has reported that the track length for his WavPack files isn't shown. After some testing, this looks like a problem with TagLib: the supplied tagreader example doesn't show length and bitrate for such a file either. I also tested with the latest revision, 1191982, same result there. Other than that, the file seems valid - it can be played back, and tags, sample rate, and channels are reported correctly. Lukas, I will send you the download link to this file. Please let me know if you received it, and what your findings on it are. Reproducible: Always
It turns out this is completely valid. The specification allows the total_samples header field to be "empty" (represented as 0xFFFFFF), which means unknown length. This file does have the header field set this way, so there is no way to determine the length without actually decoding the file. http://www.wavpack.com/file_format.txt
Too bad, guess I will have to tell the user to create the WavPack files with a different application then, or to report this to that application's developers (provided that he created the file himself, and didn't download it). I noticed that dBpoweramp's Audio Properties tab in the file's properties does show the correct length, so I'm still wondering how it does that. Do you think that it decodes the file?
Actually, I'll try something else. The file format specification suggests that the WavPack decoder can seek to the end of the file to determine the length somehow. I'll check the code to see how it does that.
Ok, so I was wrong. What I can do is to find the last block and its block_index + block_samples should be the total samples in the file. I'm not sure what is the best way to find the last block, as I don't know its size, but I'll try to come up with something.
SVN commit 1201476 by lalinsky: Fix reading of WavPack streams without a length information in the header When the WavPack's total_samples header fiels contains -1, try to find the final block and get the number of samples from there as block_index + block_samples. BUG:258016 M +2 -0 NEWS M +1 -2 taglib/wavpack/wavpackfile.cpp M +50 -1 taglib/wavpack/wavpackproperties.cpp M +10 -0 taglib/wavpack/wavpackproperties.h M +2 -0 tests/CMakeLists.txt M +4 -2 tests/Makefile.am AM tests/data/no_length.wv A tests/test_wavpack.cpp [License: UNKNOWN] WebSVN link: http://websvn.kde.org/?view=rev&revision=1201476
Works great now, thanks :)