MP3TAG:ID3V1

 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();

        }

    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值