sendCustomAudioCaptureOpusData method
- Uint8List data,
- int dataLength,
- int referenceTimeMillisecond,
- int samples,
- ZegoAudioFrameParam param, {
- 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.
dataOpus buffer data.dataLengthThe total length of the buffer data.referenceTimeMillisecondThe UNIX timestamp of this Opus audio frame in millisecond.samplesThe number of samples for this Opus audio frame.paramThe param of this Opus audio frame.channelPublish 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);
}