-
Notifications
You must be signed in to change notification settings - Fork 3
Directional Sound
Hangman edited this page Apr 3, 2023
·
6 revisions
Directional sound is a spatial sound that extends in a specified direction. Directionality works on all types of sound sources (BufferedSoundSource, StreamedSoundSource).
To illustrate, here's a video:
source.makeDirectional(direction, coneInnerAngle, coneOuterAngle, outOfConeVolume);
Sound is emitted from a directional source in a cone shape:
- Within coneInnerAngle the full volume of the source can be heard.
- Outside coneOuterAngle the volume set with outOfConeVolume is heard.
- Between coneInnerAngle (full volume) and coneOuterAngle (outOfConeVolume) the volume is interpolated.
Once you made it directional, you can update the direction the source is facing. To also update the cone angles, you can simply call makeDirectional again. That's probably a rare use case, hence there's no extra method for it.
source.setDirection(direction);
It's the opposite of directional, so it simply turns off the directionality again.
source.makeOmniDirectional();