荣耀彩票代理

  • 热门专题

Unity声音音源组件

作者:AndrewFan  发布日期:2016-12-14 20:33:08
  • 音源组件(AudioSource)

    YINYUANSHICHANGJINGZHONGZAIMOUGEWEIZHIDEFASHENGZHUANGZHI,HAOXIANGYIGELABA。TABOFANGZHEYINPINPIANDUAN (Audio Clip)。

    荣耀彩票代理FACHUDESHENGYINJIANGSHUCHUDAOSHENGYINJIANTINGQI(audio listener),HUOZHESHENGYINHUNXIAOQI(audio mixer)。SHAOHOUZAISHUOHUNXIAOQI,YIBANXIANGJIHUIMORENZIDAIYIGEAudioListenerZUJIAN,YEJIUSHISHUOYIGECHANGJINGZHONG,CUNZAILEMORENXIANGJIDEQINGKUANGXIA,WOMENZHIYAOTIANJIAYIGEYINYUAN,SHEZHILEBOFANGDEYINPINPIANDUAN,JIUKEYIWANCHENGBOFANGDECAOZUO,ERDUIYUTINGDAODESHENGYINQIANGRUOHEXIAOGUO,ZEGENJUHOUXUXUYAOJIESHIDECANSHULAIJUEDING。

    音源可以播放任意类型的音频片段(Audio Clip),它可以被配置为 2D音源、 3D音源或者2D、3D的混合形式(Spatial Blend,即空间混合,稍后会进行解释)。

    荣耀彩票代理SHENGYINKEYITONGGUODUOGEYANGSHENGQIJINXINGSHUCHU,YONGYUMONILITISHENG 。(KEYIMONICHU7.1SHENGDAODELITISHENG,7.1SHENGDAOXITONGDEZUOYONGJIANDANLAISHUOJIUSHIZAITINGZHEDEZHOUWEIJIANLIQIYITAOQIANHOUSHENGCHANGXIANGDUIPINGHENGDESHENGCHANG) 。

    SHENGYINYEKEYIZAI3DHE2DZHIJIANJINXINGKONGJIANHUNHEBIANHUAN,ZHEIZHONGBIANHUANKEYITONGGUOZAIJULISHANGDESHUAIJIANQUXIANLAIJINXINGKONGZHI。LINGWAI,RUGUOSHENGYINJIANTINGQI(listener) BANSUIZHEYIGEHUOZHEDUOGEHUIYINQUYU(Reverb Zones), YINYUANJIANGTONGSHICHANSHENGHUIYIN。

    荣耀彩票代理YEKEYIDUIYINYUANYINGYONGYIXIETESHUDEYINPINLVBOQILAIHUODEGENGJIAFENGFUDEYINXIAOTIYAN。JUTIJIESHIKEYIKANYINPINXIAOGUOWENDANG( Audio Effects)。

    AudioSource组件属性参数:

属性名称:

中文名称:

功能解释:

Audio Clip

YINPINPIANDUAN

ZHIXIANGJIJIANGBOFANGDEYINPINPIANDUAN(Audio Clip)。

Output

YINYUANSHUCHU

KEYISHUCHUDAOYINPINJIANTINGQI(AudioListener)HUOZHE(AudioMixer)。DANGSHEZHIWEIKONGSHI,JIDAIBIAOSHUCHUDAOAudioListener,ERSHEZHIDAOAudioMixerSHIXUYAOZHIDINGJUTIDEAudioMixer。

Mute

SHIFOUJINGYIN

荣耀彩票代理JIYINYUANZAIJIXUBOFANG,DANSHIBEIJINGYIN。YUGUANBIYINYUANDEQUBIESHI,DANGHUIFUSHI,BOFANGDEJINDUBUTONG。{DUIYUYOUXIZHONGYINXIAODEZANTINGZUIHAOSHIYONGZHEIXIANG,TABUHUIXIEZAISHENGYINSHUJU,KEYIZUODAOJISHIBOFANG,YINXIAOYIBANBIJIAODUO、ZHANYONGNEICUNXIAO,SHIYONGJINGYINKEYIRANGHUAMIANKUAISUXIANGYING,QIEKEYILIKEHUIFUDANGQIANYINXIAO,ZANTINGYINLEKEYISHIYONGAudioSourceDEPause、StopHUOZHEGameObjectDEenable,YIBANBUXUYAOJISHIXIANGYING,CISHIKEYISHIYONGStop,TAHUIXIEZAIYINPINSHUJUJIESHENGNEICUN。DANGRANRUGUONEICUNFUYUYEKEYISHIYONGQITAFANGSHI,ZHUYIMuteGENQITAFANGSHIDEQUBIE:MuteDEYINYUANZAIJIXUBOFANGZHE,ZHISHITINGBUDAOERYI,PauseSHIBOFANGZANTING,ERStopSHIWANQUANTINGZHI,HUIFUSHIJIANGCONGTOUBOFANG。}

Bypass Effects

YINYUANLVBOKAIGUAN

荣耀彩票代理SHINEIXIEZUOYONGZAIDANGQIANYINYUANDEYINPINLVBOQIDEKAIGUAN。{LVBOQIBAOKUO“GAOTONGLVBO”、“DITONGLVBO”、“HUIBOLVBO”、“NIUQULVBO”、“HUIYINLVBO”、“HESHENGLVBO”DENG,ZHEIXIELVBOQIKEYISHEZHIZAIYINYUANHUOZHEJIANTINGQISHANG,GOUXUANCIXIANGSHI,JIANGSHINEIXIESHEZHIZAIYINYUANDELVBOQISHIXIAO}

荣耀彩票代理Bypass Listener Effects

JIANTINGQILVBOKAIGUAN

SHINEIXIEZUOYONGZAIDANGQIANJIANTINGQIDEYINPINLVBOQIDEKAIGUAN。{TONGSHANG,GOUXUANCIXIANGSHI,JIANGSHINEIXIESHEZHIZAIJIANTINGQIDELVBOQISHIXIAO}

Bypass Reverb Zones

HUIYINHUNXIAOKAIGUAN

DANGGOUXUANSHI,BUZHIXINGHUIYINHUNXIAO,JIBIANXIANZAIWANJIAWEIYUHUIYINQUYU,CIYINYUANYEBUHUICHANSHENGHUIYIN。HUIYINXIAOGUOQUJUEYUJIANTINGQIWEIZHI(YIBANDAIBIAOWANJIAWEIZHI)YUHUIYINQUYUWEIZHIGUANXI,ERYUYINYUANMEIYOUZHIJIEGUANLIAN。XIANGXIJIAN“HUIYINQUYU”ZHANGJIE。

荣耀彩票代理Play On Awake

QIDONGBOFANGKAIGUAN

荣耀彩票代理RUGUOGOUXUANDEHUA,NEIMEDANGGameObjectJIAZAIBINGQIYONGSHI,LIKEBOFANGYINPIN,JIXIANGDANGYUCIYINYUANGameObjectDEZUJIANZHONGAwakeFANGFAZUOYONGSHIKAISHIBOFANG。RUGUOBUGOUXUANDEHUA,XUYAOSHOUDONGDIAOYONGPlay()FANGFAZHIXINGBOFANG。

Loop

XUNHUANBOFANGKAIGUAN

DANGGOUXUANSHI,RUGUOYINPINBOFANGJIESHU,JIANGCONGTOUKAISHIZAICIXUNHUANBOFANG。

Priority

BOFANGYOUXIANJI

JUEDINGLEDANGQIANYINYUANZAIDANGQIANCHANGJINGCUNZAIDESUOYOUYINYUANZHONGDEBOFANGYOUXIANJI。(YOUXIANJI: 0 = ZUIZHONGYAO. 256 = ZUIBUZHONGYAO. MORENZHI = 128.). BEIJINGYINLEZUIHAOSHIYONG0,BIMIANTAMENYOUSHIBEIQITAYINYUANTIHUANCHUQU。{YIBANSHOUJIHUOZHEQITABOFANGSHEBEIZUIDUOYUNXU32GEYINYUANTONGSHIBOFANG,ZHEIGEYOUXIANJICANSHUJUEDINGLEZAICHAOCHUYINYUANSHUMUSHI,XUYAOZANSHIGUANBIYIXIEBUZHONGYAODEYINYUAN,YOUXIANBOFANGGENGZHONGYAODEYINYUAN}

Volume

YINYUANYINLIANG

CIYINLIANGDAIBIAOLEJIANTINGQICHUYUJULIYINYUAN1MISHIDEYINLIANGDAXIAO,DAIBIAOLEZUIDAYINLIANGCHUDESHENGYINDAXIAO。

Pitch

YINPINYINDIAO

DAIBIAOLEBOFANGYINPINSHISUDUDEBIANHUALIANG,MORENZHISHI1,DAIBIAOLEZHENGCHANGDEBOFANGSUDU。{DANG<1SHI,MANSUBOFANG,DANG>1SHI,KUAISUBOFANG,SUDUYUEKUAI,ZEYINDIAOYUEGAO}

Stereo Pan

SHENGDAOZHANBI

CISHUZHIZAI[-1,1]ZHIJIANBIANHUA,DAIBIAOLE2DYINYUANDEZUOYOUSHENGDAOZHANBI,MORENZHIWEI0,DAIBIAOZUOYOUSHENGDAOSHUCHUTONGYANGYINLIANGDAXIAO。{CISHUZHIZHENDUI2DYINYUANHUOZHE2D、3DHUNHEYINYUANYOUXIAO,CHUN3DYINYUANWUXIAO}

Spatial Blend

KONGJIANHUNHE

荣耀彩票代理CISHUZHIZAI[0,1]ZHIJIANBIANHUA,ZHIDINGDANGQIANYINYUANSHI2DYINYUAN、3DYINYUAN,HAISHIERZHECHAZHIDEFUHEYINYUAN,CICANSHUJUEDINGLEYINQINGZUOYONGZAICIYINYUANSHANGDE3DXIAOGUODEFENLIANG。

{ZHUYAOYINGXIANG“3D Sound Settings”SHUXINGZUZHONGDECANSHUBIAOXIAN,BIRU,RUGUOSHI2DYINYUAN,SHENGYINZAIJULISHANGBUSHUAIJIAN,YEJIUMEIYOUDUOPULEXIAOGUO。WULUN2D、3D,YUYINPINLVBOQIBUGUANLIAN。LIRUJIBIANSHICHUN2DYINYUAN,TARENGRANXIANGYINGHUIYINQUYU,ERLVBOQIDEKONGZHIZHUYAOYOUXIANGYINGDELVBOCANSHUHEYINYUANLVBOHUNHECANSHUJUEDING,HUNHECANSHURUQIANMIANJIANGDAODEBypass Effects、Bypass Listner EffectsLIANGGEKAIGUANYIJIHOUMIANJIANGDAODEReverb Zone Mix。

YEJIUSHISHUO,CICANSHUYU“3D Sound Settings”SHUXINGZUZHONGDE3DYINPINSHEZHICANSHUGONGTONGZUOYONGGOUCHENGZUIZHONGDESHUCHU,ERDANGCHUN2DYINYUANSHI,3DYINPINSHEZHIJIANGWUSHI,CHUN3DYINYUANSHI,3DYINPINSHEZHIDEDAOWANZHENGSHUCHU,FEICHUNQINGKUANGZECHAZHIHUNHESHUCHU。}

Reverb Zone Mix

HUIYINHUNHE

SHEZHISHUCHUDAOHUNXIANGQUYUZHONGDEXINHAOLIANG,YIBANZAI[0,1]FANWEINEIBIANHUA, BUGUOYEYUNXUEWAIZUIDUOFANGDA10FENBEI(1 - 1.1]LAIZENGQIANGSHENGYINDEYUANJINXIAOGUO。{YEJIUSHISHUO,HUIXIANGXIAOGUODEHUIXIANGJULIDENGHENDUOFUZACANSHUZHUYAOYOUHUIXIANGLVBOQISHIXIAN,ERHUIXIANGYINLIANGDAXIAOZHUYAOYOUCIYINZILAIJIANDANKONGZHI}

3D Sound Settings

3D音频设置

YIXIACANSHUANBILIYUKONGJIANHUNHECANSHUGONGTONGZUOYONG

Doppler Level

DUOPULEDENGJI

ZAI[0,5]ZHIJIANBIANHUA,MORENZHIWEI1,JUEDINGLEYINYUANDEDUOPULEXIAOYINGDEFENLIANG,RUGUOSHEZHIWEI0,ZEMEIYOUDUOPULEXIAOYING。{DUOPULEXIAOYINGZHIDESHIDANGJIANTINGQIYUYINYUANZHIJIANFASHENGXIANGDUIYUNDONGSHI,SHENGYINCHUANDISUDUFASHENGBIANHUASHIDEXIAOGUO。

JIASHEYOUYIJIAFEIJILVEGUOSHANGKONG,FEIJISHANGDEJINGBAOQIMEIGEYIMIAOZHONGFACHUYICISHENGYIN,RUGUOXIANGDUIJINGZHI,ZETINGDAODEXIAOGUOSHIWANZHENGDEMEIGEYIMIAOYICIJINGBAO(JINGUANFACHUDAOTINGDAOXUYAOJIAOZHANGDESHIJIAN,DANSHIJIANGEYINGGAISHIYIYANGDE),ERDANGFEIJIXIANGWOKUAISUKAOJINSHI,YOUYUJULIZAIBUDUANSUODUAN,CONGFASHENGDAOTINGDAODEJULIZAIBUDUANSUOXIAO,YINCICHUANDISUOHUADESHIJIANYUELAIYUESHAO,WOFANGTINGDAODEJINGBAOYINGGAISHIYUELAIYUEJINCU,ERFEIJUNYUNDEMEIMIAOYICI,KAOJINSUDUYUEKUAI,JINGBAOJIANGEYUEDUAN。DANGFEIJIKUAISULIQUSHI,ZEQINGKUANGQIAHAOXIANGFAN,JINGBAOSHENGYINJIEZOUYUELAIYUESONGHUAN。}

Spread

CHUANBOJIAODU

荣耀彩票代理SHEZHIYANGSHENGQIKONGJIANDELITISHENGCHUANBOJIAODU。{HAOXIANGSHAOSHAOYINGXIANGLEHUIYINXIAOGUO,QITAZANSHIMEIKANCHUTAIDADEYINGXIANG,RUGUODUZHEYOUGENGXIANGXIJIESHIQINGGAOZHI。}

Min Distance

ZUIXIAOJULI

MORENZHIWEI1MI,DAIBIAOLEYINLIANGQUXIANZHONGDEZUIDAYINLIANGWEIZHI。CHAOYUEZUIXIAOJULISHI,SHENGYINJIANGZHUJIANSHUAIJIAN。RUGUOZENGDAZUIXIAOJULI,ZEJIANGXIANGDANGYUZENGDALE3DSHIJIEZHONGDESHENGYIN,YINWEIZUIXIAOJULIYIXIADEWEIZHIJUNHUODEZUIDAYINLIANG。RUGUOJIANXIAOZUIXIAOJULI,ZEXIANGDANGYUJIANXIAOLE3DSHIJIEZHONGSHENGYIN。{YINWEIYOUVolumeCANSHUKEZHI,ZAIQUXIANSHANG1MICHUWEIZUIDAYINLIANG,MORENQUXIAN<1MICHUJUNHUODEZUIDAYINLIANG,ERDANGMinDistance<1SHI,MORENQUXIANZHONGX=1CHUDEYINLIANGXIANGYINGYEHUIBIANXIAO。ZHUYISHANGTUZHONGListenerSHUXIANDAIBIAOLEJIANTINGQIYUDANGQIANYINYUANDEXIANGDUIJULI,ERYUVolumeQUXIANDEJIAODIANJISHI:1MICHUDEZUIDAYINLIANGJINGGUO3DSHIJIEJULICHUANBODAODANGQIANWEIZHIERSHUAIJIANHOUDEYINLIANGDAXIAO,JIRUGUOZAIQUXIANSHANG,1MICHUYZUOBIAOSHI0.8,ERListenerCHUYZUOBIAOSHI0.4,NEIMEZUIZHONGYINLIANGSHISHUAIJIANLE50%,CICANSHUYUVolumeCANSHUGONGTONGZUOYONGSHUCHUZUIZHONGYINLIANGDAXIAO,YEJIVolume*0.5}

Max Distance

ZUIDAJULI

DANGCHAOCHUCIJULISHI,SHENGYINJIANGTINGZHISHUAIJIAN。{ZHUYIZHEILISHITINGZHISHUAIJIAN,YEJIUSHISHUO,HOUXUGENGYUANCHUTINGDAODESHENGYINJIANGBAOCHIZAIZUIDAJULIDIANDESHENGYINDAXIAO,BUDAIBIAOSHENGYINWEI0}

Rolloff Mode

SHUAIJIANMOSHI

DAIBIAOLESHENGYINZAIJULISHANGDESHUAIJIANSUDU, (JUTISHUAIJIANSHUZHIYOUQUXIANJUEDING,X-JULI,Y-SHUAIJIANHOUSHENGYUBAIFENBI).

- Logarithmic Rolloff

对数衰减曲线

荣耀彩票代理YUZHIDEDUISHUSHUAIJIANQUXIAN,KEYIXIUGAI。

荣耀彩票代理- Linear Rolloff

线性衰减曲线

荣耀彩票代理YUZHIDEXIANXINGSHUAIJIANQUXIAN,KEYIXIUGAI。

- Custom Rolloff

自定义衰减曲线

荣耀彩票代理ZIDINGYIDESHUAIJIANQUXIAN,WANQUANSHOUDONGSHEZHI。

荣耀彩票代理YINYUANKEYISHEZHIDESHUAIJIANQUXIANMOXING

距离曲线函数

荣耀彩票代理YIXIASHENGYINSHUXINGKEYITONGGUOJULIQUXIANLAIXIUGAI,CICHUDEJULISHIZHIYINYUANHEJIANTINGQIZHONGDEJULI。

Volume荣耀彩票代理: 振幅(0.0 - 1.0)在距离上的变化曲线。

Spatial Blend: 空间混合参数在距离上的变化曲线, 空间混合参数代表了2D音源-3D音源的插值,2D音源:原始的声道匹配,3D音源:将当前所有声道混合转换成单声道,在距离和方向上进行衰减。

Spread荣耀彩票代理: 传播角度在距离上的变化曲线(degrees 0.0 - 360.0)。

Low-Pass (只有当音源添加低通滤波器LowPassFilter时出现): 截断频率(22000.0–10.0) 在距离上的变化曲线。

Reverb Zone: 回音混合参数在距离上的变化曲线,注意振幅属性、距离和方向上的衰减将被首先应用到信号,因此它们将同时影响到直接传播的声音信号和回音信号。

荣耀彩票代理JULIQUXIANHANSHU,BAOKUOZHENFU(Volume)、KONGJIANHUNHE(Spatial Blend)、CHUANBOJIAODU(Spread)、DITONGLVBOQI(Low-Pass audio filter)HEHUIYINHUNHE(Reverb Zone Mix)。

荣耀彩票代理SHANGTUZHONGDANGQIANJIANTINGQIDAODANGQIANYINYUANJULIYOUHONGSECHUIZHIXIANDUANBIAOCHU。NIKEYITONGGUOZHIJIEBIANJICIQUXIANLAIGAIBIANCIJULIHANSHU。RUGUOBIANJIQUXIAN,KEYICHAKANBIANJIQUXIAN(Editing Curves)。

创建音源

荣耀彩票代理RUGUOYINYUANMEIYOUBEIFUYUYINPINPIANDUAN(Audio Clip),NEIMETASHENMEYEBUHUIZUO。YINPINPIANDUANSHIZHINEIXIEKEYIBEIBOFANGDEYINPINWENJIAN。YINYUANJIUXIANGSHIYIGEBOFANGQI,KEYITONGGUOTAKONGZHIYINPINPIANDUANDEBOFANG、TINGZHIHEGAIBIANBOFANGSHUXING。

XINJIANYINYUANDEBUZHOU:

导入音频文件到你的Unity工程.它们就是音频片段(Audio Clips)。 通过菜单:GameObject->Create Empty,创建一个空对象。 选中此GameObject,选择Component->Audio->Audio Source来添加音源脚本组件。 在inspector面板中,将步骤1中的音频片段赋给音源组件。

小技巧:荣耀彩票代理 如果你想快速为某个音频片段创建一个音源,你可以拖动这个音频片段到某个GameObject的属性面板(inspector)上,或者直接拖动到场景中任意位置,两种情况下都将自动创建音源脚本。

延伸阅读:

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规