在Unity 5.0中混音

One of the big areas of focus for Unity 5.0 has definitely been in audio. After a quiet period of feature development in this area, we have been working hard at taking audio to a first class feature within Unity.

音频无疑是Unity 5.0的主要关注领域之一。 在此领域进行了一段时间的功能开发后,我们一直在努力将音频带入Unity中的一流功能。

To make this work we first had to take a step back and re-work a lot of the underlying asset pipeline and resource management of audio within Unity. We had to make our codec choices solid and ensure we had a framework that allowed you guys to have a lot of good quality sounds in your game. I’ll try and cover this in detail in a later post, but right now I want to talk about our first big audio feature offering in Unity 5.0, the AudioMixer.

为了完成这项工作,我们首先必须退后一步,并重新设计Unity中的许多基础资产管道和音频资源管理。 我们必须使我们的编解码器选择更加扎实,并确保我们拥有一个允许你们在游戏中获得许多高质量声音的框架。 我将在以后的文章中尝试详细介绍,但是现在我想谈谈Unity 5.0中的第一个重要音频功能,即AudioMixer。

我们的第一步 (Our First Move)

Besides creating a solid foundation for future audio development in Unity, we wanted to give you guys a shiny new feature as our first big ‘we want you to make awesome audio’ offering. Something to show we mean business and want to empower you as best we can on the audio front.

除了为Unity将来的音频开发奠定坚实的基础外,我们还希望为大家提供一个闪亮的新功能,这是我们的第一个重要功能,“我们希望您制作出色的音频”产品。 可以表明我们的意思是生意,并希望在音频方面尽最大努力赋予您权力。

There are a number of areas within the audio system we will be improving over the coming release cycles. Some of them are small and address the little issues that have been outstanding in Unity thus far, things you could consider as fixing the existing feature set. Some of them will be larger, like the ability for users to make amazing interactive sounds, immersive music systems and control to a high detail the mix of the audio soundscape.

在未来的发行周期中,我们将改进音频系统中的许多领域。 它们中的一些很小,可以解决迄今为止Unity中尚未解决的小问题,您可以将其视为解决现有功能集的问题。 它们中的一些会更大,例如用户能够发出令人惊叹的交互式声音,沉浸式音乐系统,并能够控制音频音景的高细节。

为什么选择AudioMixer? (Why the AudioMixer?)

The question of why we chose the AudioMixer as the first big feature to push in Audio 5.0 can be answered pretty simply. Previously there was no way in which true sub mixing of audio was possible within Unity. Sounds could be played on an AudioSource where effects could be added as Components, from there all the sounds within the game were mixed together at the AudioListener where effects could be added to the entire soundscape.

为什么我们选择AudioMixer作为推入Audio 5.0的第一个主要功能的问题可以很简单地回答。 以前,无法在Unity中实现真正的音频子混音。 可以在AudioSource上播放声音,在其中可以将效果添加为Components,然后将游戏中的所有声音在AudioListener处混合在一起,然后可以将效果添加到整个音景中。

We decided to address this with the AudioMixer, and while we were there we thought we would take it to the next level, incorporating many features you would find in established Digital Audio Workstation applications.

我们决定使用AudioMixer来解决这个问题,我们在那里的时候我们认为我们会将其提升到一个新的水平,并结合了许多您在已建立的数字音频工作站应用程序中可以找到的功能。

声音类别 (Sound Categories)

在Unity 5.0中混音_第1张图片

As many sound engineers know, it is super useful to be able to combine collections of sounds into categories and apply volume control and effects over the entire category in one place. Hooking up those volumes and effect parameters to game logic is effectively having a master control over an entire area of the game’s soundscape.

正如许多声音工程师所知道的那样,将声音集合组合到类别中并在一个地方对整个类别应用音量控制和效果是非常有用的。 将这些音量和效果参数连接到游戏逻辑,可以有效地对游戏音景的整个区域进行总体控制。

This control over the mix of the entire soundscape is super important! Its a fantastic way of controlling the mood and immersion of the audio mix. A good mix and music track can take players through the full range of emotions during gameplay, and create atmospheres that are not possible with graphic flair alone.

控制整个音景的混合非常重要! 它是一种控制混合音频的气氛和沉浸感的绝妙方法。 良好的混音和音乐轨道可以使玩家在玩游戏时充分感受各种情绪,并创造出仅凭图形才能无法实现的氛围。

在Unity中混合 (Mixing In Unity)

This is the purpose of the AudioMixer. Its an asset that users can incorporate into their scenes that control the overall mix of all the sounds in the game. All the sounds playing in a scene can be routed into one or more AudioMixer which will categorise them and apply all sorts of modifications and effects to the mix of those sounds.

这是AudioMixer的目的。 它是一项资产,用户可以将其合并到场景中,以控制游戏中所有声音的整体混合。 可以将场景中播放的所有声音路由到一个或多个AudioMixer中,后者将对它们进行分类并将各种修改和效果应用于这些声音的混合。

在Unity 5.0中混音_第2张图片

Each AudioMixer can have a hierarchy of categories defined, which in the case of the AudioMixer are called AudioGroups. You also view a lineup of these AudioGroups with a traditional mixing desk layout which many from the music and film industry with be used to.

每个AudioMixer可以具有定义的类别层次结构,在AudioMixer的情况下,这些类别称为AudioGroups。 您还可以通过传统的调音台布局查看这些AudioGroup的阵容,这些布局通常来自音乐和电影行业。

数字信号处理器 (DSP)

SingleStrip

Now we are getting somewhere!  Not only can you now create custom routing schemes and mixing hierarchies, but you can put all sorts of DSP goodies anywhere in the signal chain, allowing all sorts of effect options over your soundscapes. You can even add a dry path around effects to allow only a portion of the signal to be processed by it.

现在我们到了某个地方! 现在,您不仅可以创建自定义路由方案和混合层次结构,而且还可以在信号链中的任何位置放置各种DSP插件,从而在音景中提供各种效果选项。 您甚至可以在效果周围添加干燥路径,以仅处理一部分信号。

But what if you want more DSP control that just the inbuilt effects of Unity? Previously this was handled exclusively with the OnAudioFilterRead script callback, which allowed you to process audio samples directly in your scripts.

但是,如果您想要更多的DSP控制功能,而不仅仅是Unity的内置效果,该怎么办? 以前,这是通过OnAudioFilterRead脚本回调专门处理的,它使您可以直接在脚本中处理音频样本。

This is great for lightweight effects or prototyping your fancy filter ideas. Sometimes though, you want the ability to write native compiled effects for the best performance. Allowing you to write more heavy weight ideas, perhaps like your custom convolution reverb or multi band EQ.

这对于轻量级效果或花式滤镜创意的原型非常有用。 但是有时候,您希望能够编写本机编译效果以获得最佳性能。 使您可以编写更重的想法,例如自定义卷积混响或多频段均衡器。

在Unity 5.0中混音_第3张图片

Unity now also supports custom DSP plugin effects, with users having the ability to write their own native DSP for their game, or perhaps distributing their amazing effect ideas on the Asset Store for others to use. This opens up a whole world of possibilities, from writing your own synth engine to interfacing other audio applications like Pure Data. These custom DSP plugins can also request sidechain support and will be supplied sidechain data from anywhere else in the mix! Hawtness!

Unity现在还支持自定义DSP插件效果,用户可以为自己的游戏编写自己的本机DSP,或者可以在Asset Store上分发其惊人的效果想法供其他人使用。 从编写您自己的合成引擎到与其他音频应用程序(如Pure Data)进行接口,这打开了一个无限的可能性。 这些自定义DSP插件还可以请求侧链支持,并且可以从混合中的任何其他位置提供侧链数据! wt!

One of the cool things possible with the effect stack in an AudioGroup is that you can apply the groups attenuation anywhere in the stack. You can even boost the signal now as we allow volume levels up to +20dB. The inspector even has a integrated VU meter to show you exactly what is happening with the signal at the point of attenuation.

使用AudioGroup中的效果堆栈,很酷的事情之一是您可以在堆栈中的任何位置应用组衰减。 由于我们允许最高+ 20dB的音量,您现在甚至可以增强信号。 检查器甚至具有集成的VU仪表,可以准确显示衰减点信号的状态。

在Unity 5.0中混音_第4张图片

When combined with non-linear DSP, Sends / Receives and our new Ducking insert (which will be explained later in this post), it becomes a super powerful way of controlling the flow of audio signal through a mix.

当与非线性DSP,发送/接收以及我们的新Ducking插件(将在本文后面进行解释)结合使用时,它将成为一种通过混合控制音频信号流的超级强大方式。

情绪转变 (Mood Transitions)

I talked earlier about controlling the mood of the game with the mix of the soundscape. This can be achieved with bringing in and out new stems of music or ambient sounds. Another common way to achieve this is to transition the state of the mix itself. Changing the volume of sections of the mix and transitioning to different parameter states of effects is an effective way of taking the mood of a player where you want them to go.

我之前谈到了通过音景的混合来控制游戏的气氛。 这可以通过引入和导出音乐或环境声音的新词干来实现。 实现此目的的另一种常用方法是转换混合物本身的状态。 改变混音部分的音量并将其转换为效果的不同参数状态是一种使您的演奏者随心所欲的有效方法。

Inside all AudioMixers is the ability to define snapshots. Snapshots capture the state of all of the parameters in the AudioMixer. Everything from effect wet levels to AudioGroup pitch levels can be captured and transitioned between.

所有AudioMixers内部都具有定义快照的功能。 快照捕获AudioMixer中所有参数的状态。 从效果湿音电平到AudioGroup音调电平的所有内容都可以捕获并在它们之间转换。

在Unity 5.0中混音_第5张图片

You can even create complex blend states between a whole bunch of Snapshots within your game, creating all sorts of possibilities and uses.

您甚至可以在游戏中的一系列快照之间创建复杂的混合状态,从而创建各种可能性和用途。

Imagine walking from an open field section of your map into a sinister cave and have the mix transition to highlight more subtle ambiences, bring in different instruments of your music ensemble and change reverb characteristics of the foley. Imagine setting this up without having to write a line of script code..

想象一下,从地图的开放区域进入险恶的洞穴,进行混合过渡以突出更微妙的氛围,引入音乐合奏的不同乐器,并改变foley的混响特性。 想象一下,无需编写一行脚本代码即可进行设置。

发散信号 (Divergent Signal)

But the power of Snapshots becomes especially augmented when combined with Sends, Receives and Ducking.

但是,与“发送”,“接收”和“回避”结合使用时,快照的功能会特别增强。

发送 (Sends)
在Unity 5.0中混音_第6张图片

Aside from traditional insert DSP effects available in Unity, you can also insert a “Send” anywhere into the mix. A Send effectively branches the audio signal wherever the Send is inserted, and within Sends you can choose how much of the signal you wish to branch off.

除了Unity中可用的传统插入DSP效果外,您还可以在混音中的任何位置插入“发送”。 无论在何处插入“发送”,发送都会有效地分支音频信号,在“发送”中,您可以选择要分支的信号数量。

Things are now becoming even more interesting! Given that the level of signal you branch is part of the snapshot systems, you can start to see how you can incorporate signal flow changes with snapshot transitions. From here the potential setup possibilities start snowballing.

现在事情变得越来越有趣! 鉴于您分支的信号级别是快照系统的一部分,您可以开始了解如何将信号流更改与快照转换结合在一起。 从这里开始,潜在的设置可能性开始滚雪球。

But where does this branched signal go? Currently there two options in Unity for a Send to target, Receives and Volume Ducking.

但是这个分支信号会去哪里呢? 当前,Unity中有两个用于发送至目标的选项,即接收和大容量回避。

收到 (Receives)

Receives are fairly straight forward processing units. They are inserts just like any other effect and they simply take all the branched audio from all the Sends that target them and mix it together, passing it off to the next effect in the AudioGroup.

接收是相当简单的处理单元。 就像其他效果一样,它们是插入片段,它们只是从所有以它们为目标的发送中获取所有分支的音频,然后将它们混合在一起,然后传递给AudioGroup中的下一个效果。

Receives can of course be placed anywhere in a group of effects and the attenuation point of an AudioGroup, which gives huge flexibility on when the branched signal should be introduced to the mix.

接收器当然可以放置在一组效果和AudioGroup的衰减点中的任何位置,这为何时将分支信号引入混音提供了极大的灵活性。

体积低头 (Volume Ducking)

Sends can also target Volume Ducking insert units. Much like Receives, these units can be placed anywhere in the mix alongside your other DSP effects.

发送也可以针对“低头插入”插入单元。 与接收类似,这些单元可以与其他DSP效果一起放置在混音中的任何位置。

在Unity 5.0中混音_第7张图片

When a Send is targeting a Volume Ducking insert, it acts much like a side chain compressor setup, meaning you can side chain from anywhere in the mix and apply volume ducking anywhere else from it!

当“发送”以“音量降低”插入为目标时,它的行为与侧链压缩器设置非常相似,这意味着您可以在混音中的任何位置进行侧链操作,并在其任何其他位置应用音量降低!

What does this mean for the layman? Imagine you and mixing your FPS game and you want to avalanche the player with the sound of gunfire and explosions. Fair enough, but what about when you walk up to an NPC in the field of battle and you need to hear the sagely words they utter? Volume Ducking allows you to dynamically lower the volume of entire sections of the mix (in this case, all the ordnance sounds) off other sections of the mix (the NPC talking). You simply have to Send from the AudioGroup containing all the NPC dialog to a Volume Ducking unit on the Ordnance AudioGroup.

这对外行意味着什么? 想象一下,混合FPS游戏,您想用枪声和爆炸声来雪崩玩家。 足够公平,但是当您走上战场上的NPC并需要听见他们说出的明智话时呢? 音量降低可让您动态降低混音整个部分(在这种情况下,所有弹药的声音)的音量,使其远离混音的其他部分(NPC在说话)。 您只需要将包含所有NPC对话框的AudioGroup发送到Ordnance AudioGroup上的Volume Ducking单元。

You could even apply side chain compression to your musical setup dynamically, having the rest of your instruments compressed off the bass track.

您甚至可以动态地将侧链压缩应用于您的音乐设置,而将其余乐器压缩到低音轨道之外。

The best thing is you can set this all up in the editor without a line of code!

最好的事情是,您可以在编辑器中设置所有内容而无需一行代码!

分词 (Parting Words)

Even though I have really only scratched the surface of possibilities the AudioMixer provides in this post, I hope its enough to sparks peoples interest in the possibilities of audio in Unity 5.0.

即使我真的只是在本文中仅涉及到AudioMixer提供的可能性的表面,但我希望它足以引起人们对Unity 5.0中音频可能性的兴趣。

Unity 5.0 and beyond we really want to push the future of audio in games, giving you the suite of tools you need to make awesome sounding stuff!

Unity 5.0及更高版本,我们真的想推动游戏音频的未来,为您提供制作出色音效所需的工具套件!

Let us know your thoughts!

让我们知道您的想法!

The Audio Team

音频团队

PS: Wayne will talk about  New Audio Radness in Unity 5.0 at Unite 2014, August 22, 13:30-14:30. See you there!

PS:Wayne将于8月22日13:30-14:30在Unite 2014上谈论Unity 5.0中的新音频辐射度。 到时候那里见!

奖励视频:在Unity中击败混音! (Bonus Video: Beat mixing in Unity!)

翻译自: https://blogs.unity3d.com/2014/07/24/mixing-sweet-beats-in-unity-5-0/

你可能感兴趣的:(游戏,python,java,人工智能,大数据)