zoukankan      html  css  js  c++  java
  • [open source]Lrc歌词解析器发布

    Lrc歌词解析器发布

     

    最近一段时间专心学习英语,主要是想提高听说能力。从网上下载了《走遍美国》的mp3来听,比较简单,基本上可以听懂。偶尔遇到一个句子比较生僻,我想重新听一遍,我的意思是仅仅是重放一个最近一个句子或者一个段落,而mp3播放器上只能从头播放整个文件,极为不爽。

     

    我想可以运用LRC来控件MP3播放器,让它前后跳动时,不但可以一个文件一个文件的跳,而且可以一个句子一个句子的跳,这样可能比较人性化一点。

     

    解析LRC并不难,以前写过一个LRC歌词解析器,并在几款手机上使用。今天重新实现了一个LRC解析器,主要是想换一种方式实现它,以便验证一些设计上的想法。

     

    重复发明轮子的唯一好处是可以从中得到乐趣、验证自己的想法。这也是我重新实现Lrc歌词解析器的目的。在编程时,同时考虑了资源受限情况下的应用,可以很容易的移植到mp3播放器上。基本测试用例已经通过了,占用了周五晚上和周六整一天,等有时间了再完善。有兴趣的朋友可以到这里下载。

     

    修改历史:

    2006-8-24 0.2 修改lrc_default_builder_on_lrc中一个BUG,谢谢网友Jqliao <liaojianqiu#163.com>

     

    附录(不好意思,忘了原文的出处了)

    1LRC歌词格式

    LRC 歌词是一种包含着"[*:*]"形式的"标签(tag)"的、基于纯文本的歌词专用格式。最早由郭祥祥先生(Djohan)提出并在其程序中得到应用。这种歌词文件既可以用来实现卡拉OK功能(需要专门程序),又能以普通的文字处理软件查看、编辑。当然,实际操作时通常是用专门的LRC歌词编辑软件进行高效编辑的。以下具体介绍LRC格式中的"标签"

     

    2.时间标签(Time-tag

    形式为"[mm:ss]""[mm:ss.fff]"(分钟数:秒数)。

    数字须为非负整数,比如"[12:34.5]"是有效的,而"[0x0C:-34.5]"无效。

    它可以位于某行歌词中的任意位置。一行歌词可以包含多个时间标签(比如歌词中的迭句部分)。根据这些时间标签,用户端程序会按顺序依次高亮显示歌词,从而实现卡拉OK功能。另外,标签无须排序。

     

    3.标识标签(ID-tags

    其格式为"[标识名:]"。大小写等价。以下是预定义的标签。

    [ar:艺人名]

    [ti:曲名]

    [al:专辑名]

    [by:编者(指编辑LRC歌词的人)]

    [offset:时间补偿值] 其单位是毫秒,正值表示整体提前,负值相反。这是用于总体调整显示快慢的

     

    [ti:i swear]

    [ar:kenny rogers]

    [al:]

    [offset:2500]

    [00:15.85]I see the questions in your eyes

    [00:20.87]I know what's weighin' on your mind

    [00:26.72]You can be sure I know my heart

    [00:33.41]And I'll stand beside you through the years

    [00:40.93]You'll only cry those happy tears

    [00:46.78]And though I would make mistakes

    [00:50.96]I'll never break your heart

    [00:55.98]I swear by the moon and the stars in the sky ... I'll be there,

    [01:06.84]I swear, like a shadow that's by your side ... I'll be there

    [01:18.55]For better or worse, till death do us part

    [01:24.40]I'll love you with every beat of my heart ... and I swear

    [01:42.79]I'll give you every thing I can

    [01:48.64]I'll build your dreams with these two hands

    [01:54.49]We'll hang some memories on the walls

    [02:01.18]And when there's silver in your hair

    [02:07.86]You won't have to ask if I still care

    [02:13.72]'Cos as the time turns the page, my love won't age at all

    [02:22.91]And I swear by the moon and the stars in the sky ... I'll be there

    [02:34.61]I swear, like the shadow that's by your side ... I'll be there

    [02:46.32]For better or worse, till death do us part

    [02:52.17]I'll love you with every beat of my heart ... and I swear

    [03:20.17]For better or worse, till death do us part

    [03:25.60]I'll love you with every beat of my heart

    [03:30.62]I swear, I swear, oh ... I ... swear...

  • 相关阅读:
    Enterprise Library 4.1 Data Access Block 快速使用图文笔记
    敏捷开发(名字起得很帅,很忽悠人)原则 括号里面加了自己的理解笔记
    与弟弟谈话的摘要
    练习:选头像控件
    [转]保护你的flash(as3)程序基于socket方式传送swf文件
    Silverlight 又多了一套skin
    Silverlight制作逐帧动画
    Silverlight Spy 2 源代码查看器
    跨平台开发silverlight
    Silverlight 2 搜索照片 Live
  • 原文地址:https://www.cnblogs.com/zhangyunlin/p/6167860.html
Copyright © 2011-2022 走看看