WAV track length

Brett Hoyle kickbits at gmail.com
Thu Jul 1 14:17:55 CEST 2010


TagLib still does not support returning the track length for wav files:
https://bugs.kde.org/show_bug.cgi?id=116033

The quickest and easiest way to get the track length is to get the size of the "data" chunk and divide by the averagebyterate.
The below doesn't work but is my idea of how this could be fixed at the bottom of wavfile.cpp.
I think this would only need a minor change to be able to compile but I can't work it out :)

    else if(chunkName(i) == "data" && readProperties)
	{
		if(d->properties->bitrate != 0 )
			d->properties->length = chunkName(i).size() / (d->properties->bitrate / 8);
	}



More information about the taglib-devel mailing list