我不知道 C# 包装器,但 libsndfile C 和 C++ api 具有允许读取和写入块中包含的信息的命令功能,例如广播信息和其他字符串:
// Open input file
SndfileHandle inputFile(inputFileName, SFM_READ);
// Read broadcast info:
SF_BROADCAST_INFO binfo;
file.command(SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo));
std::cout() << binfo.description;
// Open output file with same parameters:
SndfileHanle outputFile(outputFileName, SFM_WRITE, inputFile.format(), inputFile.channels(), inputFile.samplerate());
// Copy broadcast info:
outputFile.command(SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo));
// Copy other string info:
outputFile.setString(SF_STR_TITLE, inputFile.getString(SF_STR_TITLE));
outputFile.setString(SF_STR_COPYRIGHT, inputFile.getString(SF_STR_COPYRIGHT));
outputFile.setString(SF_STR_SOFTWARE, inputFile.getString(SF_STR_SOFTWARE));
outputFile.setString(SF_STR_ARTIST, inputFile.getString(SF_STR_ARTIST));
outputFile.setString(SF_STR_COMMENT, inputFile.getString(SF_STR_COMMENT));
outputFile.setString(SF_STR_DATE, inputFile.getString(SF_STR_DATE));
outputFile.setString(SF_STR_ALBUM, inputFile.getString(SF_STR_ALBUM));
outputFile.setString(SF_STR_LICENSE, inputFile.getString(SF_STR_LICENSE));
outputFile.setString(SF_STR_TRACKNUMBER, inputFile.getString(SF_STR_TRACKNUMBER));
outputFile.setString(SF_STR_GENRE, inputFile.getString(SF_STR_GENRE));
// Copy sound data:
....