大家好,我正在使用 Taglib 库提取音频文件的元数据。我正确获取了许多字段,但无法提取创建音频文件的源设备的名称。请提出任何摆脱它的方法。使用的代码如下
MetaData md;
const char * filename = file.c_str();
std::cout<< filename;
FileRef f((FileName(filename)));
md.filepath = file;
//if(f.isNull()) return md;
// if(!f.tag()) return md;
// if(f.tag()->isEmpty()) return md;
string artist = f.tag()->artist().toCString();
string album = f.tag()->album().toCString();
string title = f.tag()->title().toCString();//.to8Bit(true);
uint year = f.tag()->year();
uint track = f.tag()->track();
int bitrate = f.audioProperties()->bitrate();
string comment=f.tag()->comment().toCString();
string genre =f.tag()->genre().toCString();
// length in second
int lenght=f.file()->audioProperties()->length();
int channel = f.file()->audioProperties()->channels();
string name =f.file()->name();
int sampleRate=f.audioProperties()->sampleRate();