my_lyric

Last updated:

0 purchases

my_lyric Image
my_lyric Images
Add to Cart

Description:

my lyric

A Flutter package to encode and decode lrc.
DOCS/文档 #

中文文档

Features #

You can use it to parse music lyric String (.lrc), lrc look like:

[00.11.22] hello coolight


And than return a object for reading and writing easily.
my_lyric support so many lrc standard and non-standard format,
we follow casually decode and strictly encode
such as:
info:

[ti:xxx]
[ar:xxx]
[hello:xxx]
......


lyric:

[minute:second.millisecond] lyricContent

like [01:11.22] hello


[minute:second:millisecond] lyricContent

like [01:11:22] hello


[minute:second] lyricContent

like [01:11] hello


translate:

no time Or same time:





[01:11.22] lyricContent1
lyricContent1 translate

[01:33.22] lyricContent2
[01:33.22] lyricContent2 translate
copied to clipboard

mulit-time in one line:

[minute:second.millisecond][minute2:second2] lyricContent To:
[minute:second.millisecond] lyricContent
And [minute2:second2] lyricContent


time after lyricContent:

lyricContent [minute:second.millisecond]



Getting started #

install this package, add this line in your pubspec.yaml:

my_lyric:
copied to clipboard

import when you want to use this package:

import 'package:my_lyric/MyLyric.dart';
copied to clipboard
Usage #

parse .lrc String to Objects:

void test() {
final lrcStr = """
[ti:天后]
[ar:陈势安]
[00:27.43]终于找到借口
[00:30.33]趁着醉意上心头
[00:33.28]表达我所有感受
""";
final relist = MyLyric_c.decodeLrcString(
lrcStr,
);
}
copied to clipboard

encode to .lrc:

void test() async {
// lrc object list
final List<LyricSrcItemEntity_c> lrcList = [];
final lrcStr = MyLyric_c.encodeLrcString(
lrcList,
);
/// write to file:
final file = File("./test.lrc");
// create file
if(false == await file.exists()) {
await file.create(recursive: true);
}
// write
await refile.writeAsString(lrcStr);
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.