歌詞同步關鍵技術

來源:互聯網
上載者:User
詞同步關鍵技術重大升級!

歌詞時間快慢調整(全新<高效>思路)
自動跟蹤引擎(arguments)

運行代碼框

<html><head><meta http-equiv=Content-Type content=text/html; charset=gb2312><title>譜樂視聽 -- 千言萬語</title><STYLE type=text/css>TD { FONT-SIZE: 9pt; LINE-HEIGHT: 17px; }BODY{FONT-SIZE: 9pt;LINE-HEIGHT: 17px;margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}#lrcollbox td, #lrcollbox font {font-family: 黑體; font-size: 16px;}#lrcoll td { color:#0080C0; cursor: default; }#lrcbox { color:#00FF00 }#lrcfilter { filter: alpha(opacity=0) }#lrcbc { color:#FFFF33 }</STYLE></head><script language="JavaScript">self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);</script><base ><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><span id="lrcdata"><!--[ti:千言萬語][ar:鄧麗君][au:爾英][al:鄧麗君 - 寶麗金 88 極品音色系列][by:www.aboutplayer.com][00:02.00]千言萬語 - 鄧麗君[00:09.25]電影《彩雲飛》插曲[00:16.50]古月 曲 爾英 詞[00:23.70][00:25.20]<00:25.70>不<00:26.00>知<00:26.35>道<00:26.80>為<00:27.30>了<00:27.90>什<00:28.60>麽<00:30.20>[00:31.35]<00:31.85>憂<00:32.20>愁<00:32.60>它<00:33.00>圍<00:33.40>繞<00:34.15>著<00:34.60>我<00:36.60>[00:37.60]<00:38.10>我<00:38.45>每<00:38.85>天<00:39.25>都<00:39.60>在<00:40.45>祈<00:41.30>禱<00:43.80>[00:43.90]<00:44.20>快<00:44.60>趕<00:45.00>走<00:45.45>愛<00:45.95>的<00:46.50>寂<00:47.75>寞<00:48.80>[00:48.90]<00:49.20>那<00:49.50>天<00:49.95>起<00:51.30> <00:51.90>你<00:52.25>對<00:52.65>我<00:53.00>說<00:54.40>[00:54.90]<00:55.40>永<00:56.05>遠<00:56.80>地<00:57.50>愛<00:58.60>著<00:59.10>我<01:00.70>[01:00.85]<01:01.35>千<01:02.00>言<01:03.80>和<01:04.70>萬<01:05.35>語<01:06.80>[01:06.90]<01:07.25>隨<01:08.05>風<01:09.25>雲<01:10.65>掠<01:11.20>過<01:12.80>[01:14.00]<01:14.50>不<01:14.85>知<01:15.25>道<01:15.65>為<01:16.30>了<01:16.80>什<01:17.45>麽<01:19.25>[01:20.10]<01:20.60>憂<01:21.05>愁<01:21.40>它<01:21.90>圍<01:22.35>繞<01:23.05>著<01:23.40>我<01:25.60>[01:26.40]<01:26.90>我<01:27.25>每<01:27.65>天<01:28.05>都<01:28.50>在<01:29.50>祈<01:30.15>禱<01:32.50>[01:32.60]<01:33.10>快<01:33.45>趕<01:33.85>走<01:34.25>愛<01:34.90>的<01:35.40>寂<01:36.70>寞<01:39.30>[01:40.80][02:03.45]<02:03.95>不<02:04.25>知<02:04.70>道<02:05.10>為<02:05.75>了<02:06.30>什<02:06.95>麽<02:08.10>[02:09.70]<02:10.20>憂<02:10.55>愁<02:10.95>它<02:11.40>圍<02:11.85>繞<02:12.50>著<02:12.90>我<02:15.40>[02:15.90]<02:16.40>我<02:16.85>每<02:17.15>天<02:17.50>都<02:17.90>在<02:18.90>祈<02:19.60>禱<02:22.10>[02:22.20]<02:22.50>快<02:22.90>趕<02:23.30>走<02:23.75>愛<02:24.30>的<02:24.80>寂<02:26.10>寞<02:27.20>[02:27.30]<02:27.50>那<02:27.85>天<02:28.30>起<02:29.60> <02:30.10>你<02:30.50>對<02:30.90>我<02:31.40>說<02:32.50>[02:33.15]<02:33.65>永<02:34.25>遠<02:35.05>地<02:35.75>愛<02:36.90>著<02:37.40>我<02:38.65>[02:39.15]<02:39.65>千<02:40.35>言<02:42.15>和<02:43.05>萬<02:43.55>語<02:45.30>[02:45.40]<02:45.70>隨<02:46.40>風<02:47.50>雲<02:49.10>掠<02:49.70>過<02:50.90>[02:52.40]<02:52.90>不<02:53.25>知<02:53.65>道<02:54.05>為<02:54.65>了<02:55.25>什<02:55.85>麽<02:57.55>[02:58.50]<02:59.00>憂<02:59.40>愁<02:59.90>它<03:00.35>圍<03:00.75>繞<03:01.35>著<03:01.80>我<03:03.65>[03:04.75]<03:05.25>我<03:05.60>每<03:06.00>天<03:06.40>都<03:06.80>在<03:07.80>祈<03:08.50>禱<03:11.10>[03:11.20]<03:11.45>快<03:12.20>趕<03:12.60>走<03:12.90>愛<03:13.50>的<03:14.10>寂<03:15.45>寞<03:18.45>[03:19.95][03:21.25]網上服務由 www.aboutplayer.com 提供[03:28.97]--></span><center><div><input type="button" style="height:20; width:90; font-size:9pt" title="時間整體提前0.5秒/次" value="歌詞調整(+)"> <input type="button" value="歌詞調整(-)" title="時間整體滯後0.5秒/次" style="height:20; width:90; font-size:9pt" > <input type="file" name="file" style="cursor:default; height:20; width:290; font-size:9pt" title="1、播放你本地的這首歌曲2、或輸貼更有效網路連結"></div><object classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" id="aboutplayer" width="480" height="240"><param name="url" value="http://aboutplayer.com/play.asp?id=6&action=url"><param name="volume" value="100"><param name="enablecontextmenu" value="0"><param name="enableerrordialogs" value="0"></object><div id="lrcollbox" style="overflow:hidden; height:260; width:480; background-color:#000000;"><table border="0" cellspacing="0" cellpadding="0" width="100%" id="lrcoll" style="position:relative; top: -20px;" oncontextmenu="return false;"><tr><td nowrap height="20" align="center" id="lrcwt1"></td></tr><tr><td nowrap height="20" align="center" id="lrcwt2"></td></tr><tr><td nowrap height="20" align="center" id="lrcwt3"></td></tr><tr><td nowrap height="20" align="center" id="lrcwt4"></td></tr><tr><td nowrap height="20" align="center" id="lrcwt5"></td></tr><tr><td nowrap height="20" align="center" id="lrcwt6"></td></tr><tr><td nowrap height="20" align="center"><table border="0" cellspacing="0" cellpadding="0"><tr><td nowrap height="20"><span id="lrcwt7" style="height:20"></span></td></tr><tr style="position:relative; top: -20px; z-index:6"><td nowrap height="20"><div id="lrcfilter" style="overflow:hidden; width:100%; color:#FFFF33; height:20"></div></td></tr></table></td></tr><tr style="position:relative; top: -20px"><td nowrap height="20" align="center"><table border="0" cellspacing="0" cellpadding="0"><tr><td nowrap height="20"><span id="lrcbox" style="height:20">歌詞載入中</span></td></tr><tr style="position:relative; top: -20px; z-index:6;"><td nowrap height="20"><div id="lrcbc" style="overflow:hidden; height:20; width:0;"></div></td></tr></table></td></tr><tr style="position:relative; top: -40px;"><td nowrap height="20" align="center" id="lrcwt8"></td></tr><tr style="position:relative; top: -40px;"><td nowrap height="20" align="center" id="lrcwt9"></td></tr><tr style="position:relative; top: -40px;"><td nowrap height="20" align="center" id="lrcwt10"></td></tr><tr style="position:relative; top: -40px;"><td nowrap height="20" align="center" id="lrcwt11"></td></tr><tr style="position:relative; top: -40px;"><td nowrap height="20" align="center" id="lrcwt12"></td></tr><tr style="position:relative; top: -40px;"><td nowrap height="20" align="center" id="lrcwt13"></td></tr></table></div></center><script language="JavaScript">var lrcO;ffbb = 0;lrcobj = new lrcClass(lrcdata.innerHTML.slice(4,-3));function lrcClass(tt){ this.inr = []; this.oTime = 0; this.dts = -1; this.dte = -1; this.dlt = -1; this.ddh; this.fjh; lrcbc.style.width = 0; if(/\[offset\:(\-?\d+)\]/i.test(tt)) this.oTime = RegExp.$1/1000; tt = tt.replace(/\[\:\][^$\n]*(\n|$)/g,"$1"); tt = tt.replace(/\[[^\[\]\:]*\]/g,""); tt = tt.replace(/\[[^\[\]]*[^\[\]\d]+[^\[\]]*\:[^\[\]]*\]/g,""); tt = tt.replace(/\[[^\[\]]*\:[^\[\]]*[^\[\]\d\.]+[^\[\]]*\]/g,""); tt = tt.replace(/<[^<>]*[^<>\d]+[^<>]*\:[^<>]*>/g,""); tt = tt.replace(/<[^<>]*\:[^<>]*[^<>\d\.]+[^<>]*>/g,""); while(/\[[^\[\]]+\:[^\[\]]+\]/.test(tt)) { tt = tt.replace(/((\[[^\[\]]+\:[^\[\]]+\])+[^\[\r\n]*)[^\[]*/,"\n"); var zzzt = RegExp.$1; /^(.+\])([^\]]*)$/.exec(zzzt); var ltxt = RegExp.$2; var eft = RegExp.$1.slice(1,-1).split("]["); for(var ii=0; ii<eft.length; ii++) { var sf = eft[ii].split(":"); var tse = parseInt(sf[0],10) * 60 + parseFloat(sf[1]); var sso = { t:[] , w:[] , n:ltxt } sso.t[0] = tse-this.oTime; this.inr[this.inr.length] = sso; } } this.inr = this.inr.sort( function(a,b){return a.t[0]-b.t[0];} ); for(var ii=0; ii<this.inr.length; ii++) { while(/<[^<>]+\:[^<>]+>/.test(this.inr[ii].n)) { this.inr[ii].n = this.inr[ii].n.replace(/<(\d+)\:([\d\.]+)>/,"%=%"); var tse = parseInt(RegExp.$1,10) * 60 + parseFloat(RegExp.$2); this.inr[ii].t[this.inr[ii].t.length] = tse-this.oTime; } lrcbc.innerHTML = "<font>"+ this.inr[ii].n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/%=%/g,"</font><font>") +" </font>"; var fall = lrcbc.getElementsByTagName("font"); for(var wi=0; wi<fall.length; wi++) this.inr[ii].w[this.inr[ii].w.length] = fall[wi].offsetWidth; this.inr[ii].n = lrcbc.innerText; } this.run = function(tme) { if(tme<this.dts || tme>=this.dte) { var ii; for(ii=this.inr.length-1; ii>=0 && this.inr[ii].t[0]>tme; ii--){} if(ii<0) return; this.ddh = this.inr[ii].t; this.fjh = this.inr[ii].w; this.dts = this.inr[ii].t[0]; this.dte = (ii<this.inr.length-1)?this.inr[ii+1].t[0]:aboutplayer.currentMedia.duration; lrcwt1.innerText = this.retxt(ii-7); lrcwt2.innerText = this.retxt(ii-6); lrcwt3.innerText = this.retxt(ii-5); lrcwt4.innerText = this.retxt(ii-4); lrcwt5.innerText = this.retxt(ii-3); lrcwt6.innerText = this.retxt(ii-2); lrcwt7.innerText = this.retxt(ii-1); lrcfilter.innerText = this.retxt(ii-1); lrcwt8.innerText = this.retxt(ii+1); lrcwt9.innerText = this.retxt(ii+2); lrcwt10.innerText = this.retxt(ii+3); lrcwt11.innerText = this.retxt(ii+4); lrcwt12.innerText = this.retxt(ii+5); lrcwt13.innerText = this.retxt(ii+6); this.print(this.retxt(ii)); if(this.dlt==ii-1) {clearTimeout(lrcO);golrcoll(0);golrcolor(0); } this.dlt = ii; } var bbw = 0; var ki; for(ki=0; ki<this.ddh.length && this.ddh[ki]<=tme; ki++) bbw += this.fjh[ki]; var kt = ki-1; var sc = ((ki<this.ddh.length)?this.ddh[ki]:this.dte) - this.ddh[kt]; var tc = tme - this.ddh[kt]; bbw -= this.fjh[kt] - tc / sc * this.fjh[kt]; if(bbw>lrcbox.offsetWidth) bbw = lrcbox.offsetWidth; lrcbc.style.width = Math.round(bbw); } this.retxt = function(i) { return (i<0 || i>=this.inr.length)?"":this.inr[i].n; } this.print = function(txt) { lrcbox.innerText = txt; lrcbc.innerText = txt; } this.print("www.aboutplayer.com"); lrcwt1.innerText = ""; lrcwt2.innerText = ""; lrcwt3.innerText = ""; lrcwt4.innerText = ""; lrcwt5.innerText = ""; lrcwt6.innerText = ""; lrcwt8.innerText = ""; lrcwt9.innerText = ""; lrcwt10.innerText = ""; lrcwt11.innerText = ""; lrcwt12.innerText = ""; lrcwt13.innerText = "";}function loadfile(url){ aboutplayer.url = url; aboutplayer.controls.play(); file.select(); document.selection.clear(); onfocus=file.blur();}function bb(){ ffbb = ffbb - 0.5;}function ff(){ ffbb = ffbb + 0.5;}function lrcrun(){ with(aboutplayer) { lrcobj.run(controls.currentPosition + ffbb); } if(arguments.length == 0) setTimeout("lrcrun()",10);}function golrcoll(s){ lrcoll.style.top = -2-(s++)*3; if(s<=6) lrcO = setTimeout("golrcoll("+s+")",100);}function golrcolor(t){ lrcfilter.filters.alpha.opacity = 100-(t++)*10; if(t<=10) setTimeout("golrcolor("+t+")",60);}function killErrors(){ return true;}window.onerror = killErrors;lrcrun();</script></body></html>

    [Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運行]

論壇UBB代碼中輕鬆實現歌詞同步

Windows Media Player 格式:
1、[wmp=http://www.aboutplayer.com/a.wmv]歌詞內容[/wmp]
2、[wmp=http://www.aboutplayer.com/a.wma]歌詞內容[/wmp]
3、[wmp=http://www.aboutplayer.com/a.mp3]歌詞內容[/wmp]
……
Real Player 格式:
1、[rmp=http://www.aboutplayer.com/a.rm]歌詞內容[/rmp]
2、[rmp=http://www.aboutplayer.com/a.ra]歌詞內容[/rmp]
3、[rmp=http://www.aboutplayer.com/a.mp3]歌詞內容[/rmp]
……

執行個體:

[wmp=mms://222.77.177.180/mp3/2005-09-21/f528b693-e3cc-457d-8aab-6886d5c8f80a.wma][ti:美麗的神話]
[ar:孫楠&韓紅]
[al:忘不了你]
[by:rodick]
[04:41.88][01:48.65][00:02.63]美麗的神話
[00:09.91]rodick 製作
[00:16.47]夢中的人熟悉的臉孔
[00:23.72]你是我守候的溫柔
[00:31.00]就算淚水淹沒天地
[00:38.40]我不會放手,每一刻孤獨的承受
[00:53.12]只因我曾許下承諾
[01:00.43]你我之間熟悉的感動
[01:07.86]愛就要蘇醒
[02:57.49][01:14.30]萬世滄桑唯有愛是永遠的神話
[03:04.48][01:21.48]潮起潮落始終不悔真愛的相約
[03:11.88][01:28.95]幾番苦痛的糾纏多少黑夜掙紮
[03:19.20][01:36.29]緊握雙手讓我和你再也不離分
[01:59.32]枕上雪冰封的愛戀
[02:06.65]真心相搖籃才能融解
[02:13.87]風中搖曳爐上的火
[02:21.37]不滅亦不休
[02:28.80]等待花開春去春又來
[02:36.02]無情歲月笑我癡狂
[02:43.37]心如鋼鐵任世界荒蕪
[02:50.70]思念永相隨
[03:56.09][03:26.57]悲歡歲月唯有愛是永遠的神話
[04:03.24][03:33.82]誰都沒有遺忘古老,古老的誓言
[04:10.64][03:41.28]你的淚水化為漫天飛舞的彩蝶
[04:18.05][03:48.63]愛是翼下之風兩心相隨自在飛
[04:28.19]你是我心中唯一美麗的神話[/wmp]

注意事項:
1、相容視頻、音頻播放;
2、一個主題及其所有回複中只能設定一首媒體,建議放在主題帖;
3、媒體路徑可以是絕對路徑(如‘http://aboutplayer.com/a.wmv’),也可以是相對路徑(如‘../mp3/a.wma’)。



相關文章

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。