audiochorusfilter.play 播放

2015-1-3 14:27| 发布者: 杨炎| 查看: 1706| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本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函数

相关阅读

文章点评
相关文章