lrc歌词的解析可以通过通过正则表达式的方式进行解析,本文采用了此种方式。
1.定义歌词实体类
import java.util.HashMap;
import java.util.Map;
/*
* 用于封装歌词的类
* @author
*
* */
public class LrcInfo {
private String title;//music title
private String artist;//artist name
private String album;//album name
private String bySomeBody;//the lrc maker
private String offset;//the time delay or bring forward
private Map<Long,String> infos;//保存歌词信息和时间点一一对应的Map
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getArtist() {
return artist;
}
public void setArtist(String artist) {
this.artist = artist;
}
public String getAlbum() {
return album;
}
public void setAlbum(String album) {
this.album = album;
}
public String getBySomeBody() {
return bySomeBody;
}
public void setBySomeBody(String bySomeBody) {
this.bySomeBody = bySomeBody;
}
public String getOf

本文介绍如何在Android中通过正则表达式解析LRC歌词文件,主要涉及字符串操作和异常处理。

683

被折叠的 条评论
为什么被折叠?



