-
Notifications
You must be signed in to change notification settings - Fork 0
/
Documentation030_3D_spatialisation.txt
66 lines (48 loc) · 4.54 KB
/
Documentation030_3D_spatialisation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
::v3.4.0::03.2o24::2021.3.0::
================================================================================
3D spatialisation
================================================================================
Unity built-in spatializer:
---------------------------
Since the asset is compatible with Unity AudioSources as much as possible/where it makes sense,
all streams/components can be spatialised by Unity's built-in spatialization by adjusting Spatial Blend on AudioSource.
Possibly the most simple usage is demonstrated in the UnitySpatializerDemo scene together with AudioStream, and AudioStreamInput,
AudioStreamInputDemo also uses AudioStreamInput which has 3D support (but higher latency than 2D-only AudioStreamInput2D)
FMOD Resonance spatializer:
---------------------------
1.6 introduced support for FMOD's provided GoogleVR spatializer plugin, later (from 2.0) replaced by Google Resonance.
Resonance has more realistic 3D audio than Unity built-in spatializer and allows for more customization,
but note that all Resonance playback is currently via FMOD exclusively bypassing Unity (similar to AudioStreamMinimal) - so no AudioSource/AudioClip support for Unity audio interop.
The components -
ResonanceSource:
- accepts all audio formats as normal AudioStream/FMOD playback component/s and plays the content at GameObject's 3D position relative to the listener.
- use 'Output Driver ID' to play on different system audio output than default
ResonanceSoundfield:
- plays only a-, and b-format ambisonic files
- use 'Output Driver ID' to play on different system audio output than default
ResonanceInput:
- can stream from any input similarly to AudioStreamInput* and plays the input audio at GameObject's position after being processed by Resonance.
- use 'Record Device Id' to specify input to record from
- currently the input is being played back on default (0) audio output only
In all cases no special setup is needed - just attach the component on a GameObject in scene and modify exposed [3D] parameters, the audio will be played at its position
See also ResonanceSourceDemo, ResonanceSoundfieldDemo and ResonanceInputDemo scenes about how to use them via scripting
You can also set your own listener transform - otherwise it defaults to main camera transform - the sound is then played in 3D at the GameObject's position relative to this listener.
There can be multiple separate Resonance* components/GameObjects in the scene with any combination of inputs/outputs and listeners in one scene
* except the above mentioned ResonanceInput playback output
it was not previously possible to use more than one component of the same type with the same Output ID in a single scene - this restriction is now removed/fixed
- this means that it's possible for local disk media/network streams to have multiple/many audio listeners in scene, each playing on different system audio output
Performace notice:
due to way Resonance Listener/DSPs are currently used, a spearate FMOD system object is created for each 'ResonanceSource/Soundfield' in the scene
- the overhead should be negligible however and allows for use of multiple Resonance GameObjects with the same audio system output.
- there is a limit on the no. of system objects (thus these components) allowed to be created at one time which is capped at 7
(depending on what other AudioStream objects there are in scene - one is for internal usage, the overall FMOD limit is 8 -
see also https://fmod.com/docs/2.02/api/core-api-common.html#fmod_max_systems)
For more about more than one audio listener in scene *with Unity AudioSources*, please see
-- 'Documentation031_audiolisteners'--
Other spatializers:
---------------------------
Google is now providing their own proper 3D audio Unity integration in the form of Resonance Audio package that can be used instead (https://developers.google.com/resonance-audio/ , Unity 2017.1 and up)
AudioStream can be used just like any other AudioSource, so it's sufficient to just add AudioStream component to Resonance enabled game object and everything will just work.
Compared to the full Resonance package from Google, AudioStream Resonance* components lack some features such as Room properties, room transitions and sound materials.
Other 3D spatializers such as Oculus Integration for Unity ( https://developer.oculus.com/downloads/package/unity-integration/ ) and Steam Audio ( https://valvesoftware.github.io/steam-audio/ )
work with AudioStream in similar fashion, though latency might not be as low as when using provided AudioStream Resonance* components directly.