找回密碼
 注冊帳號

掃一掃,訪問微社區

audiosource 音頻源

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

摘要: audiosource 音頻源inherits frombehavioura representation of audio sources in 3d.表示在3d空間中的音頻源。an audiosource is attached to agameobjectfor playing back sounds in a 3d environment. mono sound ...

audiosource 音頻

inherits frombehaviour

a representation of audio sources in 3d.

表示在3d空間中的音頻源。

an audiosource is attached to agameobjectfor playing back sounds in a 3d environment. mono sounds play back 3d. in order to play 3d sounds you also need to have aaudiolistener. the audio listener is normally attached to the camera you want to use. stereo sounds are always played back without distance based attenuation.

audiosource附加到一個gameobject用于在3d環境中播放聲音。單聲道聲音以3d播放。為了播放3d聲音,也需要有一個audiolistener。音頻監聽器通常附加在使用的相機上。立體聲總是不以距離為基礎衰減。

you can play a single audio clip usingplay,pauseandstop. you can also adjust its volume while playing usingtime. multiple sounds can be played on one audiosource usingplayoneshot. you can play a clip at a static position in 3d space usingplayclipatpoint.

你可以使用play,pause,stop來播放音頻剪輯。也可以在播放時使用time來定位。多個聲音可以使用playoneshot在一個audiosource上播放。可以使用playclipatpoint在3d空間中的一個靜態位置播放剪輯。

參見:audiolistener,audioclip

variables變量

volume

the volume of the audio source.

音頻源的音量。

pitch

the pitch of the audio source.

音頻源的音調。

time

playback position in seconds.

以秒為單位的播放位置。

timesamples

playback position in pcm samples.

在pcm取樣的播放位置。

clip

the default audioclip to play

默認播放的音頻剪輯。

isplaying

is the clip playing right now (read only)?

剪輯現在正在播放(只讀)?

loop

is the audio clip looping?

音頻剪輯循環播放?

ignorelistenervolume

this makes the audio source not take into account the volume of the audio listener.

這使音頻源不考慮音頻監聽器的音量。

playonawake

if set to true, the audio source will automatically start playing on awake

如果設置為true,音頻源將在awake時自動播放。

velocityupdatemode

whether the audio source should be updated in the fixed or dynamic update.

audiosource是否應該以固定或動態的方式更新?

panlevel

sets how much the 3d engine has an effect on the channel.

設置多少,3d引擎在通道上有效果。

bypasseffects

bypass effects (applied from filter components or global listener filters)

直通效果(從過濾器組件或全局監聽過濾器應用)。

dopplerlevel

sets the doppler scale for this audiosource

設置這個audiosource的多普勒縮放。

spread

sets the spread angle a 3d stereo or multichannel sound in speaker space.

設置3d stereo的擴散角或揚聲器空間的多聲道聲音。

priority

sets the priority of the audiosource

設置audiosource的優先權。

mute

un- / mutes the audiosource. mute sets the volume=0, un-mute restore the original volume.

是否靜音音頻源。mute是設置音量為0,取消靜音是恢復原來的音量。

mindistance

within the min distance the audiosource will cease to grow louder in volume.

在最小距離內,audiosource將停止增大音量。

maxdistance

(logarithmic rolloff) maxdistance is the distance a sound stops attenuating at.

(對數衰減)最大距離是一個聲音停止衰減的距離。

pan

sets a channels pan position linearly. only works for 2d clips.

設置一個通道平衡調整線性位置,只工作于2d剪輯。

rolloffmode

sets/gets how the audiosource attenuates over distance

設置/獲取audiosource隨著距離衰減。

functions函數

play

plays the clip.

播放剪輯。

stop

stops playing the clip.

停止播放該剪輯。

pause

pauses playing the clip.

暫停播放該剪輯。

playoneshot

plays an audioclip.

播放一個音頻剪輯。

getoutputdata

returns a block of the currently playing source's output data

返回一個當前播放源的輸出數據塊。

getspectrumdata

returns a block of the currently playing source's spectrum data

返回當前播放源的聲譜數據塊。

class functions類函數

playclipatpoint

plays the clip at position. automatically cleans up the audio source after it has finished playing.

在指定位置播放剪輯。播放完成后自動消除音頻源。

inherited members繼承成員

inherited variables繼承變量

enabled

enabled behaviours are updated, disabled behaviours are not.

啟用行為被更新,禁用行為不更新。

transform

thetransformattached to thisgameobject(null if there is none attached).

transform附加到gameobject(游戲物體)(如無附加則為空)。

rigidbody

therigidbodyattached to thisgameobject(null if there is none attached).

rigidbody附加到gameobject(游戲物體)(如無附加則為空)。

camera

thecameraattached to thisgameobject(null if there is none attached).

camera附加到gameobject(游戲物體)(如無附加則為空)。

light

thelightattached to thisgameobject(null if there is none attached).

light附加到gameobject(游戲物體)(如無附加則為空)。

animation

theanimationattached to thisgameobject(null if there is none attached).

animation附加到gameobject(游戲物體)(如無附加則為空)。

constantforce

theconstantforceattached to thisgameobject(null if there is none attached).

constantforce附加到gameobject(游戲物體)(如無附加則為空)。

renderer

therendererattached to thisgameobject(null if there is none attached).

renderer附加到gameobject(游戲物體)(如無附加則為空)。

audio

theaudiosourceattached to thisgameobject(null if there is none attached).

audiosource附加到gameobject(游戲物體)(如無附加則為空)。

guitext

theguitextattached to thisgameobject(null if there is none attached).

guitext附加到gameobject(游戲物體)(如無附加則為空)。

networkview

thenetworkviewattached to thisgameobject(read only). (null if there is none attached)

networkview附加到gameobject(游戲物體)(只讀)(如無附加則為空)。

guitexture

theguitextureattached to thisgameobject(read only). (null if there is none attached)

guitexture附加到gameobject(游戲物體)(只讀)(如無附加則為空)。

collider

thecolliderattached to thisgameobject(null if there is none attached).

collider附加到gameobject(游戲物體)(如無附加則為空)。

hingejoint

thehingejointattached to thisgameobject(null if there is none attached).

hingejoint附加到gameobject(游戲物體)(如無附加則為空)。

particleemitter

theparticleemitterattached to thisgameobject(null if there is none attached).

particleemitter附加到gameobject(游戲物體)(如無附加則為空)。

gameobject

the game object this component is attached to. a component is always attached to a game object.

組件附加的游戲物體。一個組件總是被附加到一個游戲物體。

tag

the tag of this game object.

游戲物體的標簽。

name

the name of the object. //物體的名字

hideflags

should the object be hidden, saved with the scene or modifiable by the user?

物體是否被隱藏、保存在場景中或被用戶修改?

相關閱讀

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