【发布时间】:2015-07-28 19:25:57
【问题描述】:
我想从 mp3 文件中读取 id3tag。我知道这个在 mp3 文件的最后 128 字节中的位置。
所以我做了这个代码:
#include <stdio.h>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
FILE *pFile = fopen("1.mp3", "r");
fseek(pFile, -128, SEEK_END);
char artist;
for (int i = 0; i < 128; i++)
{
fread(&artist, sizeof(char), 1, pFile);
cout << "A: " << artist << endl;
}
getchar();
return 0;
}
不用担心输出,它只是一个样本。
谷歌搜索后,我找到了以下信息:
我的问题,我不明白为什么:
我在 Windows 上工作,例如我打开 mp3 文件属性(我想阅读)并将标题设置为 30 多个符号。使用我的程序后,在输出中我的标题只有 30 个符号,但在文件的道具中又多了。 请帮帮我,我只想知道为什么?
【问题讨论】:
标签: c++ binary mp3 binaryfiles id3