问题
I need to extract the information stored in the Xing and Fraunhofer VBRI headers of MP3 files using TagLib-Sharp.
I've searched around the web for an example, looked at the source code, but it's not obvious how to use the XingHeader and VBRIHeader classes. They don't look to be part of the File/AudioFile properties for MPEG.
The constructor needs a ByteVector class which is defined in the TagLib namespace.
Can anybody provide an example of using the XingHeader and VBRIHeader classes? Any help would be greatly appreciated.
回答1:
Something like the following should work:
foreach(ICodec codec in file.Properties.Codecs) {
Mpeg.AudioHeader header = (Mpeg.AudioHeader) codec;
if(header == null)
return;
if(header.XingHeader != Mpeg.XingHeader.Unknown) {
/* CODE HERE */
}
if(header.VBRIHeader != VBRIHeader.Unknown) {
/* CODE HERE */
}
}
来源:https://stackoverflow.com/questions/6196011/how-to-read-xingheaders-and-vbriheaders-from-mp3-files-using-taglib-sharp