找回密碼
 注冊帳號

掃一掃,訪問微社區

audiochorusfilter.play 播放

2015-1-3 14:27| 發布者: 楊炎| 查看: 1916| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: audiosource.play 播放functionplay(delay: uint64 = 0) : voiddescription描述plays theclip.播放剪輯。delay allows a source to be played later at a specific sample-accurate point in time. note that the de ...

audiosource.play 播放

functionplay(delay: uint64 = 0) : void

description描述

plays theclip.

播放剪輯。

delay allows a source to be played later at a specific sample-accurate point in time. note that the delay must be set according to the reference output rate of 44.1 khz, meaning that play(44100) will delay the playing by exactly 1 sec. note: to obtain sample accuracy with anaudioclipwith a different samplerate (than 44.1 khz) you have to do the math yourselves. delaying an audiosource with an attachedaudioclipwith samplerate of, say, 32 khz, with 16k samples(.5 sec) is done by play(22050). ((44100/32000) * 16000 = 22050).

延遲允許一個源在一個特定精確采樣時間點之后播放。請注意,延遲必須設置根據44.1 khz的輸出率,意思是播放(44100) 將延遲播放剛好1秒。注意:為了獲得audioclip準確的采樣,帶有不同的采樣率,你必須做自己的計算。延遲一個附加audioclip的audiosource,帶有采樣率,32 khz,帶有16k采樣(.5 秒)來播放(22050)。 ((44100/32000) * 16000 = 22050)。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

void awake() {

audio.play();

audio.play(44100);

}

}

audio.play();

// delay a clip by 1 sec (44100 samples) 延遲一個剪輯1秒

audio.play(44100);

參見:stop,pause,clip函數

相關閱讀

文章點評
相關文章
女校游泳队彩金