SoundPlayer
What is a SoundPlayer for?β
- It is responsible for executing a sound, whether "2D" or "3D" in the scene.
β οΈ for the sound to be heard, there must be a SoundListener in the scene, which is usually placed in the Camera β οΈ
Sound fileβ
- The sound file to play.
Load modeβ
β οΈ see more about sound loading modes at types of sound execution β οΈ
Immediateβ
- Freezes the game until the sound is fully loaded (larger sounds tend to have a longer loading time).
Asynchronousβ
- Loads sound while the game is running.
Streamβ
- Starts playing sound immediately, even while charging.
Play on startβ
- Defines whether or not sound will start when the scene loads.
Diameterβ
- The diameter of the sound.
Loopβ
- Defines whether the sound will repeat or not in a loop.
Speedβ
- The speed of sound reproduction.
Volumeβ
- The volume of the sound.
Pitchβ
- The pitch of the sound.
Modeβ
- The way of representing the sound.
2Dβ
- Runs regardless of the scene. The sound will have the same volume regardless of the distance from the SoundPlayer to the SoundListener.
3Dβ
Execute in the scene. The sound will have its volume changed according to the distance from the SoundPlayer to the SoundListener (the closer, the higher the volume, the further away, the lower the volume).
The SoundPlayer needs to be within range of the SoundListener and the SoundListener needs to be within range of the SoundPlayer for sound to be detected and heard.
Distance curveβ
- The distance curve changes the behavior of the sound according to the values ββon the graph.
Stopβ
- Stop playing sound.
Playβ
- Play the sound.