AudioSource And Audio Clip

音频源(Audio Source)在场景中播放音频剪辑(Audio Clip)。

我还是从权威来看:https://docs.unity3d.com/ScriptReference/AudioSource-clip.html

Properties 属性:

Audio Clip 音频剪辑

Reference to the sound clip file that will be played.
将被播放的声音剪辑文件

Mute 静音

If enabled the sound will be playing but muted.
如果启用,声音将被播放,但没有声音(静音)

Bypass Effects 直通效果

This Is to quickly "by-pass" filter effects applied to the audio source. An easy way to turn all effects on/off.
应用到音频源的快速"直通"过滤效果。一个简单的方法来打开/关闭所有特效。

Play On Awake
唤醒时播放

If enabled, the sound will start playing the moment the scene launches. If disabled, you need to start it using the Play() command from scripting.
如果启用,则声音会在场景启动的时候开始播放。如果禁用,则需要从脚本中使用的play()命令来启动它。

Loop 循环

Enable this to make the Audio Clip loop when it reaches the end.
启用这个属性使音频剪辑(Audio Clip)在播放结束后循环 。

Priority
优先权

Determines the priority of this audio source among all the ones that coexist in the scene. (Priority: 0 = most important. 256 = least important. Default = 128.). Use 0 for music tracks to avoid it getting occasionally swapped out.
确定场景所有并存的音频源之间的优先权。(0=最重要的优先权。256 =最不重要。默认为128。)。使用0的音乐曲目,以避免偶尔换出。

Volume 音量

How loud the sound is at a distance of 1 world unit (1 meter) from the Audio Listener.
声音从距离音频监听器(Audio Listener)1个世界单位(1米)处有多响?

Pitch 音调

Amount of change in pitch due to slowdown/speed up of the Audio Clip. Value 1 is normal playback speed.
改变音调(Pitch)值,可以减速/加速音频剪辑的播放。1是正常

播放速度。

3D Sound Settings

3D声音设置

Settings that are applied to the audio source if the is a 3D Sound.
如果是一个三维的声音,应用到音频源的设置

Pan Level
平衡调整级别

Sets how much the 3d engine has an effect on the audio source.
设置多少,3D引擎在音频源上有效果。

Spread 扩散

Sets the spread angle to 3d stereo or multichannel sound in speaker space.
设置3D立体声或者多声道音响在扬声器空间的传播角度。

Doppler Level
多普勒级别

Determines how much doppler effect will be applied to this audio source (if is set to 0, then no effect is applied).
决定了多少多普勒效应将被应用到这个音频信号源(如果设置为0,就是无效果)。

Min Distance
最小距离

Within the MinDistance, the sound will stay at loudest possible. Outside MinDistance it will begin to attenuate. Increase the MinDistance of a sound to make it 'louder' in a 3d world, and decrease it to make it 'quieter' in a 3d world.
在最小距离(MinDistance)之内,声音会保持最响亮。 在最小距离(MinDistance)之外,声音就会开始衰减。增加声音的最小距离(MinDistance),可以使声音在3D世界"更响亮",减少最小距离(MinDistance)可使声音在一个三维世界"安静"。

Max Distance
最大距离

The distance where the sound stops attenuating at. Beyond this point it will stay at the volume it would be at MaxDistance units from the listener and will not attenuate any more.
声音停止衰减距离。超过这一点,它将在距离侦听器最大距离(MaxDistance)单位,保持音量,并不会作任何衰减。

Rolloff Mode
衰减模式

How fast the sound fades. The higher the value, the closer the Listener has to be before hearing the sound.(This is determined by a Graph).
声音淡出的速度有多快。该值越高,越接近侦听器最先听到声音(这是由图形决定)。
Logarithmic Rolloff
对数衰减
The sound is loud when you are close to the audio source, but when you get away from the object it decreases significantly fast.
当你接近的音频源,声音响亮,但是当你远离对象,声音下降显着快。

Linear Rolloff
线性衰减

The more far away from the audio source you go, the less you can hear it.
越是远离音频源的,你可以听到的声音越小。

Custom Rolloff
自定义衰减

The sound from the audio source behaves accordingly to how you set the graph of roll offs.
根据你设置的衰减图形,来自音频源的声音行为。

2D Sound Settings
2D声音设置

Settings that are applied to the audio source if the is a 3D Sound.
如果是一个二维的声音,应用到音频源的设置
Pan 2D

2D平衡调整

Sets how much the engine has an effect on the audio source.
设置多少,引擎在音频源上有效果。

#######注意:如果你想创建一个音频源,只需有一个音频剪辑(Audio Clip)在你的资源文件夹,你可以拖拽音频剪辑(Audio Clip)到场景视图,那么带有音频源(Audio Source)的游戏对象将自动创建。

注意:

没有分配音频剪辑的音频源不会播放任何东西。剪辑是实际的声音文件,该文件将被播放。音频源就像是一个控制器,用于启动和停止播放该剪辑,并修改其他的音频属性。

问:那么什么是 Audio Clip 音频剪辑?

Audio Clip 音频剪辑:

被音源所使用来表现被导入到Unity的音频资产。Unity同时支持单声道和立体声音频资产。Unity支持导入以下音频文件格式:.aif, .wav, .mp3, 和 .ogg,和以下音轨模块:.xm, .mod, .it, 和 .s3m。在Unity音轨模块资源和其他音频资源一样,除了无波形预览渲染到资源导入检视面板。

Properties 属性:

Audio Format 音频格式:
The specific format that will be used for the sound at runtime.
在运行时被应用到声音上的特定格式。

Native 原生的:

Larger file size, higher quality. Best for very short sound effects.
较大文件尺寸,较高质量。最适用于很短的音效。

Compressed 压缩的:

Smaller file size, lower/variable quality. Best for medium length sound effects and music.
较小文件尺寸,较低/不稳定质量。最适用于中等长度音效与音乐。

3D Sound 三维声音:

If enabled, the sound will play back in 3D space. Both Mono and Stereo sounds can be played in 3D.
如果启用,音乐将在3D空间中播放。在Unity2.6中,单声道和立体声都可以在3D中播放。

  Force to mono 强制单声道:

If enabled, the audio clip will be down-mixed to a single channel sound.
如果启用,该音频剪辑将向下混合到单通道声音。

Load Type 加载类型

The way Unity load audio assets runtime.
运行时Unity加载音频的方法。

Decompress on load 
加载时解压缩

Decompress sounds upon load. Use this for smaller compressed sounds to avoid the performance overhead of decompressing on the fly. Beware that decompressing sounds on load will use ~10x more memory than keeping them compressed in memory, so don't use this for large files.
加载后解压缩声音。使用于较小的压缩声音,以避免运行时解压缩的性能开销。要注意加载时解压缩声音将使用比在它们在内存中压缩的多10倍或更多内存,因此不要使用这个到大文件。

Compressed in memory
在内存中压缩

Keep sounds compressed in memory and decompress while playing. This have a slight performance overhead (esp. for Ogg/Vorbis compressed files) so only use this for bigger files.
保持声音在内存中是压缩的并在播放时解压缩。这有轻微的性能开销(尤其是OGG / Vorbis格式的压缩文件),因此使用这个为大文件。

Stream from disc
从磁盘流

Stream audio data directly from disc. This uses a fraction of the original sounds size of memory. Use this for your music or very long tracks. Depending on the hardware, a general advice is to keep this down to 1-2 simultaneously streams.
直接从磁盘流音频数据。这只使用了原始声音占内存大小的很小一部分。使用这个用于很长的音乐。取决于硬件,一般建议1-2线程同时流。

Compression 
压缩

Amount of Compression to be applied to a Compressed clip. Statistics about file size can be seen beneath the slider. It is suggested to drag the slider to a place that leaves the playback "good enough" but still at a small enough size to meet your file size/distribution needs.
压缩量应用于压缩的剪辑。有关文件大小的统计可以在之后的滑动条看到。可以拖动滑条来调整来调整大小,播放声音来判断音质,但保持在一个足够小的尺寸,以满足您的文件大小/分配需要。

Hardware Decoding
硬件解码

(iOS ONLY) Available for compressed audio on iOS devices. Uses Apple's hardware decoder for less CPU intensive decompression. Check out Platform Specific details for more info.
(仅iOS)用于iOS设备压缩的音频。使用苹果的硬件解码来减少CPU的密集解压缩。

Gapless looping
无缝循环

(Android/iOS ONLY) Use this when compressing a perfect looping audio source file (in a non-compressed PCM format) to preserve the loop. Standard MPEG encoders introduce silence around the loop point, which will play as little "click" or "pop". Unity handles this smoothly for you.
(仅Android/iOS)当压缩一个完美的循环音频源文件(在一个非压缩的PCM格式)保持循环时,使用这个。标准的MPEG编码器插入silence循环点,播放时有小的"click" 或 "pop"(可能是短暂停顿的意思)。Unity为你顺畅处理这个问题。

你可能感兴趣的:(AudioSource And Audio Clip)