Audio Player
This component belongs to the following package:
- com.yahaha.sdk.audio
The Audio Player Component allows an object to make a specific sound when triggered. Attach this component to an object in the scene.
Property | Description |
---|---|
Audio Clip | Determine the audio clip that will be played by the AudioPlayer Component. |
Play On Awake | If enabled, the audio clip will start playing immediately when the scene launches. Enabled by default. |
Loop | If enabled, the audio clip will start over once it reaches the end. Disabled by default. |
Volume | Sets how loud the sound is at one meter from the audio listener. Ranges from 0 (silent) to 2 (maximum volume). Default value: 1 |
Pitch | Controls the change in pitch due to slowdown or speed up of audio. Ranges from -3 to 3. Default value: 1 (normal playback speed). |
Stereo Pan | Adjusts the balance between left and right channels for mono and stereo audio clips. Ranges from -1 (full left) to 1 (full right). Default value: 0 (center). Mono sounds will have constant power panning, while stereo sounds will have each left/right value faded up and down according to the specified pan value. |
Spatial Blend | Sets the degree to which the audio player is affected by 3D spatial calculations, such as doppler and spread. A value of 0 results in full 2D sound, while 1 enables full 3D spatialization. Ranges from 0 to 1. Default value: 1 (full 3D). |
Reverb Zone Mix | Determines how much of the output signal is sent to the reverb zones. The mix amount scales linearly in the 0 - 1 range, with an optional 10 dB amplification in the 1 - 1.1 range, allowing for simulating both near-field and distant sounds. Default value: 1 (full mix without amplification). |
Doppler Level | Specifies the change in pitch based on the relative velocity between the listener and the audio player. Ranges from 0 to 5. Default value: 0. |
Spread | Sets the spread angle in degrees for a 3D sound in the speaker space. Ranges from 0 to 360. Default value: 0. |
Volume Rolloff | Sets the type of rolloff curve, determining how fast the audio fades based on the listener's distance from the audio source. Default: Cosine.
|
Min Distance | Defines the minimum distance at which the audio will remain at its maximum volume. Beyond this distance, the volume will begin to attenuate. Default: 1. |
Max Distance | Specifies the distance beyond which the audio's volume will remain constant and no longer attenuate. Default: 500. |
Events and Actions
Events
- None
Actions
- Play: Plays the clip.
- Arguments
- self: The audioPlayer object.
- Arguments
- UnPause: Resumes the paused playback of this AudioPlayer.
- Arguments
- self: The audioPlayer object.
- Arguments
- Pause: Pauses playing the clip.
- Arguments
- self: The audioPlayer object.
- Arguments
- SetVolume: Modifies the volume level.
- Arguments
- self: The audioPlayer object.
- value: The desired volume level to set.
- fadeDuration: The duration for the volume to gradually change.
- Arguments