Skip to content

An lyric parser for Android and Java . Lyric LRC format file. Parse LRC lyric format content into a readable form.

License

Notifications You must be signed in to change notification settings

authorfu/LrcParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Basic Usage an introduction of LRC format can be found here

####1. From a lyric file content to all readable lyric

String lyricString="[00:12.00]Line 1 lyrics\n"+
		 "[00:17.20]Line 2 lyrics\n"+
		 "[00:21.10]Line 3 lyrics";
BufferedReader reader =new BufferedReader(new StringReader(lyricString));
Lyric lyric;
try{
	lyric=LrcParser.create(reader);
	String[] contents=lyric.findAllContents();
	System.out.println(Arrays.toString(contents));
}catch(IOException e){
	e.printStackTrace();
}

result:

[Line 1 lyrics, Line 2 lyrics, Line 3 lyrics]

####2.More info ArrayList sentences=lyric.findAllSentences(-1,-1); System.out.println(sentences);

result:

[{index:0|12000(Line 1 lyrics)17199}, {index:1|17200(Line 2 lyrics)21099}, {index:2|21100(Line 3 lyrics)-1}]

#####Sentence a Sentence is a class which presents a line of lyric from fromTime to toTime filled by a content and positioned by an index .

private long fromTime=-1;// milliseconds, sentence start include
private long toTime=-1;// milliseconds,sentence end time include
private String content="";// content of the sentence
private int index=-1;//position of the sentence in the lyric

####3.ID Tags ID Tags info can be found by a HashTable<String,String> tags= lyric.getTags();

####4. more useful methods see com.github.authorfu.lrcparser.Lyric

About

An lyric parser for Android and Java . Lyric LRC format file. Parse LRC lyric format content into a readable form.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages