Audio¶
Your space is more interesting and immersive with music and sound effects.
Setting up background music(BGM)¶
BGM is the music you can hear when you switch to Play mode and it can be heard wherever you go in the scene. BGM is enabled by default in YAHAHA Studio, but you need to specify the audio clip to make it work, as follows:
-
Find BGM by choosing General in the Settings Explorer window.
-
Select an audio clip as your BGM either from your assets or collections.
Adding audio clips to an object¶
To attach audio clips to an object:
-
Select the object and view its properties by choosing the More icon.
-
Add an Audio component by choosing **+ Feature
-
>**Gameplay>Audio.
-
Add audio to the component. You can add multiple audio clips.
Property Description Audio file The file of the audio to add Loop Determines whether to loop the audio clip Volume The volume of the sound. Ranges from 0 to 150%. Default: 100%. Pitch The amount of pitch change caused by slowing/accelerating the audio clip. Ranges from -3 to 3. Default: 1. Type Specifies the sound type: - 3D, the sound is played with spatialization. It will have volume attenuation based on the distance from the event distance and the listener, as well as panning based on the location of the event distance to the direction the listener is facing.
- 2D, the sound is played without spatialization.
Min Distance The distance beyond which the sound starts to attenuate. Ranges from 1 to 100. Default: 5. Max Distance The distance at which the sound stops attenuating. Ranges from 1 to 100. Default: 50. Volume Rolloff Determines how fast the sound fades. The higher the value, the closer the audio listener has to be to make the sound audible. - Logarithmic, the sound is loud when you are close to the audio source, but it quickly fades when you move away from it.
- Linear, the sound becomes less audible as you move away from the audio source.
DopplerLevel Determines how much Doppler effect will be applied to the audio source. Ranges from 0 to 5 Object Determines the trigger of the audio clip to be the object it is attached to or another object Condition Determines the trigger of the audio clip: - On Start, the audio clip plays as soon as you switch to Play mode.
- Touched by player, the audio clip plays when the trigger object is touched by the player.
- On Enter, the audio clip plays when the player enters the trigger box.
- On Exit, the audio clip plays when the player exits from the trigger box.
- Insufficient health, the audio clip plays when the player's health drops below a specified threshold.
- Global Quest Complete, the audio clip plays when a specific quest attached to an object is complete.
- Global Dialog Complete, the audio clip plays when a specific dialog attached to an object is complete.<
- Quest Complete (self), the audio clip plays when a specific quest attached to the object itself is complete.
- Dialog Complete(self), the audio clip plays when a specific quest attached to the object itself is complete.