public class LrcAnalyze {
/**
* [ar:艺人名] [ti:曲名] [al:专辑名] [by:编者(指编辑LRC歌词的人)] [offset:时间补偿值]
* 其单位是毫秒,正值表示整体提前,负值相反。这是用于总体调整显示快慢的。
* */
// parse taget artist
private final String TagAr = "[ar:";
// perse taget tittle
private final String TagTi = "[ti:";
// perse target album
private final String TagAl = "[al:";
// perse target author of the lrc
private final String TagBy = "[by:";
// perse taget offset
private final String TagOff = "[offset:";
// record the file
private FileInputStream filein;
// record the file
private File file;
// get lrc artist
public static final int ARTIST_ZONE = 0;
// get lrc tittle
public static final int TITTLE_ZONE = 1;
// get lrc album
public static final int ALBUM_ZONE = 2;
// get lrc author
public static final int AOTHOR_ZONE = 3;
// get lrc offset
public static final int OFFSET_ZONE = 4;
// get lrc
public static final int LRC_ZONE = 5;
// lrc data contract
public class LrcData {
public int type;
public String Time; // time of string format
public long TimeMs; // time of long format ms
// public char TimeHour; // hour of time
// public char TimeMinute; // minute of time
// public char TimeSecond; // second of time
// public char TimeMilliSecond; // millisecond of time
public String LrcLine; // one line lrc
}
// record analyzed lrc
private List<LrcData> LrcList;
/**
* constract
* */
public LrcAnalyze(File file) {
try {
filein = new FileInputStream(file);
this.file = file;
LrcList = new ArrayList<LrcData>();
LrcAnalyzeStart();
} catch (
Java LRC 歌词解析
最新推荐文章于 2021-11-12 11:11:38 发布
这篇博客主要介绍了如何使用Java处理LRC歌词文件,通过读取每一行并转化为UTF-8编码来解决中文显示问题。内容包括电影《黄飞鸿》主题曲《将军令》的歌词示例,以及LrcAnalyzeStart方法的代码片段。
摘要由CSDN通过智能技术生成