using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace WindowsFormsApplication1
{
public class ID3V1
{
private MP3Stream mp3Stream;
private string _header;
/// <summary>
/// 3byte ;必须为 TAG
/// </summary>
public string Header
{
get { return _header; }
}
private string _title;
/// <summary>
/// 30byte ;标题
/// </summary>
public string Title
{
get { return _title; }
}
private string _author;
/// <summary>
/// 30byte ;作者
/// </summary>
public string Author
{
get { return _author; }
}
private string _classic;
/// <summary>
/// 30byte ;专辑
/// </summary>
public string Classic
{
get { return _classic; }
}
private string _year;
/// <summary>
/// 4byte ;年代
/// </summary>
public string Year
{
get { return _year; }
}
private string _comment;
/// <summary>
/// 28byte ;备注
/// </summary>
public string Comment
{
get { return _comment; }
}
private byte _reserve;
/// <summary>
/// 1byte ;保留
/// </summary>
public byte Reserve
{
get { return _reserve; }
}
private byte _track;
/// <summary>
/// 1byte ;音轨
/// </summary>
public byte Track
{
get { return _track; }
}
private byte _genre;
/// <summary>
/// 1byte ;类型
/// </summary>
public byte Genre
{
get { return _genre; }
}
public ID3V1(MP3Stream stream)
{
mp3Stream = stream;
_title = mp3Stream.ReadText(30, Encoding.Default);
_classic = mp3Stream.ReadText(30, Encoding.Default);
_author = mp3Stream.ReadText(30, Encoding.Default);
_year = mp3Stream.ReadText(4, Encoding.ASCII);
_comment = mp3Stream.ReadText(28, Encoding.Default);
_reserve = mp3Stream.ReadByte();
_track = mp3Stream.ReadByte();
_genre = mp3Stream.ReadByte();
}
}
}