转自:http://www.ceeger.com/Components/class-AudioSource.html

音频源(Audio Source)在场景中播放音频剪辑(Audio Clip)。如果音频剪辑(Audio Clip)是一个3D剪辑,音频源是在一个给定的位置,并会随距离衰减这样的方式进行播放。

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.
    设置多少,引擎在音频源上有效果。

Types of Rolloff 衰减类型

There are three Rolloff modes: Logarithmic, Linear and Custom Rolloff. The Custom Rolloff can be modified by modifying the volume distance curve as described below. If you try to modify the volume distance function when it is set to Logarithmic or Linear, the type will automatically change to Custom Rolloff.

衰减模式有三种:对数,线性和自定义衰减。自定义衰减可以修改通过修改音量的距离曲线,如下所述。当它被设置为对数或线性类型时,如果你修改音量距离函数,类型将自动更改为自定义衰减。


Rolloff Modes that an audio source can have. 音频源的衰减模式

Distance Functions 距离函数

There are several properties of the audio that can be modified as a function of the distance between the audio source and the audio listener.

有音频的几个的属性,作为 音频源和音频侦听器之间的距离的函数,可以被修改。

Volume: Amplitude(0.0 - 1.0) over distance. 音量:幅度(0.0-1.0)随距离
Pan: Left(-1.0) to Right(1.0) over distance. 平衡调整: 左(-1.0)到右(1.0)随距离
Spread: Angle (degrees 0.0 - 360.0) over distance. 扩散:角度(0.0到360.0度)随距离
Low-Pass (only if LowPassFilter is attached to the AudioSource): Cutoff Frequency (22000.0-10.0) over distance. 
低通(只有当低通滤波器(LowPassFilter)贴到音频源(AudioSource)上): 低通截止频率(10.0~22000.0hz)随距离。


Distance functions for Volume, Pan, Spread and Low-Pass audio filter. The current distance to the Audio Listener is marked in the graph.

音量,平衡调整,扩散和低通音频滤波器的距离函数。当前到音频监侦听器的距离在图中标记。

To modify the distance functions, you can edit the curves directly. For more information, see the guide to Editing Curves.

要修改的距离函数,您可以直接编辑曲线。想了解更多信息,请参阅编辑曲线(Editing Curves)的指南。

Creating Audio Sources 创建音频源

Audio Sources don't do anything without an assigned Audio Clip. The Clip is the actual sound file that will be played back. The Source is like a controller for starting and stopping playback of that clip, and modifying other audio properties.

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

To create a new Audio Source 创建一个新的音频源:

  1. Import your audio files into your Unity Project. These are now Audio Clips. 
    导入你的音频文件到Unity项目。这些都是现在的音频剪辑。
  2. Go to GameObject->Create Empty from the menubar. 
    从菜单栏选择 GameObject->Create Empty
  3. With the new GameObject selected, select Component->Audio->Audio Source. 
    随着新的游戏对象(GameObject) 被选择,选择 Component->Audio->Audio Source
  4. Assign the Audio Clip property of the Audio Source Component in the Inspector. 
    在检视面板中分配音频源 (Audio Source)组件的音频剪辑属性。

Note: If you want to create an audio source just for one Audio Clip that you have in the Assets folder, you can drag and drop that Audio Clip to the scene view and an Audio Source game object will be created automatically for it.

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

Audio Source 音频源相关推荐

  1. 傅里叶变换音频可视化_Web Audio在音频可视化中的应用

    Web Audio在音频可视化中的应用 本文有两个关键词:音频可视化和Web Audio.前者是实践,后者是其背后的技术支持. Web Audio 是很大的知识点,本文会将重点放在如何获取音频数据这块 ...

  2. 网易云音乐动效Android,Web Audio在音频可视化中的应用(网易云音乐鲸云动效)...

    本文有两个关键词:音频可视化和Web Audio.前者是实践,后者是其背后的技术支持. Web Audio 是很大的知识点,本文会将重点放在如何获取音频数据这块,对于其 API 的更多内容,可以查看 ...

  3. Android 音频源码分析——AndroidRecord录音(一)

    Android 音频源码分析--AndroidRecord录音(一) Android 音频源码分析--AndroidRecord录音(二) Android 音频源码分析--AndroidRecord音 ...

  4. WAVE-U-NET: A MULTI-SCALE NEURAL NETWORK FOR END-TO-END AUDIO SOURCE SEPARATION-----论文翻译

    WAVE-U-NET: 一个用于端到端音源分离的多尺度神经网络 作者:Daniel Stoller.Sebastian Ewert.Simon Dixon 摘要:   音频源分离模型通常在幅度频谱上操 ...

  5. 【Unity】Audio Source组件——用代码动态控制音效的播放、暂停

    1.代码控制播放.暂停.停止 给游戏物体添加Audio Source组件 把音频文件拖入Audio Source组件的AudioCilp中 创建一个脚本并挂载 using System.Collect ...

  6. Audio播放音频 --- 建立播放通道

    Audio播放音频 - 建立播放通道 简介 虽然文章标题是<建立播放通道>,其实播放通道早在AudioPolicyManager解析configuration配置文件时,openoutpu ...

  7. Audio Converter 音频转码

    iOS使用Audio Converter 把源格式转换成目标格式,既可以在各种线性PCM音频格式之间转换,也可以在线性PCM格式与其他压缩格式之间转换.支持转换包括如下内容: PCM bit dept ...

  8. H5的Audio API音频

    h5出现之前,要进行Web音频的展示,往往需要在浏览器加载flash等插件,h5中新增的<audio>标签允许用户进行一些基本的音频流操作,但是对于一些复杂的音频处理应用,其功能远远不能满 ...

  9. Android 音频源码分析——AudioTrack设备选择

    Android 音频源码分析--AndroidRecord录音(一) Android 音频源码分析--AndroidRecord录音(二) Android 音频源码分析--AndroidRecord音 ...

最新文章

  1. centos 安装mysql5.6.20_CentOS 7 安装MySQL 5.6遇到的疑难杂症小结
  2. Java设计模式(十七):责任链设计模式
  3. Android权限申请的学习实践
  4. XMC-GAN:从文本到图像的跨模态对比学习
  5. C++实现链式存储线索二叉树
  6. java取当前日期_java如何获取系统的当前时间
  7. 月薪2万是一种怎样的人生体验?
  8. 个人博客开发系列:前台博客页面开发部署完成
  9. AutoResetEvent类的使用
  10. macos 管理员权限 黑苹果_Mac OS X 黑苹果系统安装驱动Kext方法
  11. html用图片链接网址
  12. Linux的numactl
  13. 10代cpu能装服务器系统不,第10代CPU可以装Windows7吗
  14. 浅谈人工智能:现状、任务、构架与统一
  15. 计算机如何更改后缀文件名,如何批量修改文件后缀名(任何文件的扩展名)?
  16. 网页dom元素过多为什么会导致页面卡顿
  17. 用一条sql语句判断两个日期是否处于同一月份!
  18. 网上跳蚤市场网站系统HTML5+Vue+nodejs
  19. 2018年浏览器横向比较
  20. python项目实例源码哪里下载-Python从入门到项目实践 PDF 全彩带源码版

热门文章

  1. 关于最新安装cocapods所遇到的问题(坑)
  2. SOCKET函数详解
  3. java h2数据库_JAVA 项目中使用 H2 数据库
  4. 【vuex状态管理案例mutations和actions区别】
  5. Cordova+React+OnsenUI+Redux新闻App开发实战教程-姜博-专题视频课程
  6. 谈谈美国大学的常任轨(tenure track)制度
  7. 相关系数与python实现
  8. 基于SpringCloud+vue+element设计的手机端网络购物商城
  9. word全角字符改半角2021-09-24
  10. JAVA实现shp文件转wkb文件