enableSpatializer abstract method

Future<void> enableSpatializer(
  1. bool enable
)

Turn the 3D spatial sound on or off.

Available since: 2.11.0 Description: After the 3D sound effect is turned on, the sound effect in the actual space will be simulated according to the position of the speaker equivalent to the listener. The intuitive feeling is that the sound size and the left and right sound difference will also change when the distance and orientation of the sound source change. Use case: It is a feature of audio recognition in FPS games or social scene games. Default value: When this function is not called, 3D sound effects are turned off by default. When to call: After initializing the range audio createRangeAudio. Caution: The 3D audio effect will only take effect when setRangeAudioMode is called and set to World mode. Related APIs: After enabling the 3D sound effect, you can use updateAudioSource or updateSelfPosition to change the position and orientation to experience the 3D effect.

  • enable Whether to enable 3D sound effects.

Implementation

Future<void> enableSpatializer(bool enable);