enableVirtualStereo method

Future<void> enableVirtualStereo(
  1. bool enable,
  2. int angle
)

Enable or disable the virtual stereo effect when publishing stream.

Available since: 1.10.0; Note: Starting from 2.15.0, the angle parameter supports setting -1 to present a all round virtual stereo effect. Description: Call this function to enable / disable the virtual stereo effect when publishing stream. Use cases: Often used in live broadcasting, voice chatroom and KTV. When to call: It needs to be called after createEngine. Caution: You need to set up a dual channel with setAudioConfig for the virtual stereo to take effect.

  • enable true to turn on the virtual stereo, false to turn off the virtual stereo.
  • angle The angle of the sound source in virtual stereo in the range of -1 ~ 360, with 90 being directly in front, 0 / 180 / 270 corresponding to the rightmost and leftmost respectively. In particular, when set to -1, it is all round virtual stereo effects.

Implementation

Future<void> enableVirtualStereo(bool enable, int angle) async {
  return await ZegoExpressImpl.instance.enableVirtualStereo(enable, angle);
}