sendCustomAudioCaptureOpusData method

Future<void> sendCustomAudioCaptureOpusData(
  1. Uint8List data,
  2. int dataLength,
  3. int referenceTimeMillisecond,
  4. int samples,
  5. ZegoAudioFrameParam param, {
  6. ZegoPublishChannel? channel,
})

Sends Opus audio data produced by custom audio capture to the SDK (for the specified channel).

Available since: 3.25.0 Description: Sends the captured audio Opus data to the SDK. Use cases: 1.The customer needs to obtain input after acquisition from the existing audio stream, audio file, or customized acquisition system, and hand it over to the SDK for transmission. 2.Customers have their own requirements for special sound processing for Opus input sources. After the sound processing, the input will be sent to the SDK for transmission. When to call: After enableCustomAudioIO and publishing stream successfully. Restrictions: None. Related APIs: Enable the custom audio IO function enableCustomAudioIO, and start the push stream startPublishingStream.

  • data Opus buffer data.
  • dataLength The total length of the buffer data.
  • referenceTimeMillisecond The UNIX timestamp of this Opus audio frame in millisecond.
  • samples The number of samples for this Opus audio frame.
  • param The param of this Opus audio frame.
  • channel Publish channel for capturing audio frames.

Implementation

Future<void> sendCustomAudioCaptureOpusData(Uint8List data, int dataLength,
    int referenceTimeMillisecond, int samples, ZegoAudioFrameParam param,
    {ZegoPublishChannel? channel}) async {
  return await ZegoExpressImpl.instance.sendCustomAudioCaptureOpusData(
      data, dataLength, referenceTimeMillisecond, samples, param,
      channel: channel);
}