Re: [問題] 關於sound.start(secondOffset,loop)~
※ 引述《jing007 (嗚~合購版讓我變肥肥肥豬)》之銘言:
: 感謝各位的指點~
: 關於Sound.start(secondOffset,loop)有點疑問
: 就是在跑的時侯 不知為何secondOffset如何設值 就是一直重頭開始唱
: secondOffset不是指定卻播放聲音的開始位置嗎?
: 不是說我設600,就是要放由600秒才開始唱的歌嗎?@@
: 後來一生氣 直接設值在裡面 還是重頭唱…… = =|||
: 有沒有其他播歌的函式…(別建議我寫一個…我可寫不出來:::> <:::)
: 另我將Sound.start()置於我所設的一些onReleaseシ onReleaseOutside …等
: 去抓完拉軸所計算出所對應的音樂位置程式碼後來 以便直拉完後就直接唱了
: 但偏偏上下兩行偵測用的都有跑出結果來 但就是不唱…
: 難道Sound.start()有特別的用法嗎? 謝謝~
在用Sound類別的時候,它的數字單位就讓我覺得這個類別的設計有點機車了
Sound.duration 單位是milliseconds
Sound.position 單位是milliseconds
public start([secondOffset:Number], [loops:Number]) : Void
這裡的secondOffset單位卻是seconds...
secondOffset:Number [optional] - A parameter that lets you start playing
the sound at a specific point. For example, if you have a 30-second sound
and want the sound to start playing in the middle, specify 15 for the
secondOffset parameter. The sound is not delayed 15 seconds, but rather
starts playing at the 15-second mark.
如果要把抓出來的position要再塞回去給start當參數時的時候,需要再除以1000
供你參考 :)
--
http://www.eddie.com.tw/blog/
http://www.eddie.com.tw/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.135.172.127
推
04/27 12:57, , 1F
04/27 12:57, 1F
※ 編輯: aquarianboy 來自: 220.133.136.105 (04/27 16:15)
推
04/27 18:36, , 2F
04/27 18:36, 2F
→
04/27 18:36, , 3F
04/27 18:36, 3F
討論串 (同標題文章)
Flash 近期熱門文章
PTT數位生活區 即時熱門文章