Video SDK for MacOS API Reference
Loading...
Searching...
No Matches
ZMVideoSDKAudioSender Class Reference

Interface for sending raw audio data. More...

#include <ZMVideoSDKAudioSendRawdata.h>

Inherits NSObject.

Instance Methods

(ZMVideoSDKErrors) - send:dataLength:sampleRate:channel:
 Sends audio raw data, and sampling bits must be 16.

Detailed Description

Interface for sending raw audio data.

Definition at line 18 of file ZMVideoSDKAudioSendRawdata.h.

Method Documentation

◆ send:dataLength:sampleRate:channel:

- (ZMVideoSDKErrors) send: (char *) data
dataLength: (unsigned int) length
sampleRate: (int) rate
channel: (ZMVideoSDKAudioChannel) channel 

Sends audio raw data, and sampling bits must be 16.

Parameters
dataData Pointer to the audio data buffer.
lengthThe length of audio data in bytes (must be an even number).
rateSampling rate of the audio data. Supported rates depend on the channel count:
  • Mono: 8000, 11025, 16000, 32000, 44100, 48000, 50000, 50400, 96000, 192000, 2822400
  • Stereo: 8000, 16000, 32000, 44100, 48000, 50000, 50400, 96000, 192000
channelIdentifies the audio data channel type. default is ZMVideoSDKAudioChannel_Mono.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Note
  1. The size of a single input must not exceed the number of bytes corresponding to 100 ms of audio. Exceeding this limit returns ZMVideoSDKErrors_RAWDATA_SEND_TOO_MUCH_DATA_IN_SINGLE_TIME.
  2. Variable-length input is supported; it is recommended to send audio data in 10 ms, 20 ms, or 30 ms chunks (not exceeding 100 ms).
  3. If ZMVideoSDKErrors_RAWDATA_SEND_TOO_FREQUENTLY is returned, this is not a genuine error; please wait briefly before retrying—for example, sleep for 10 ms before attempting to send the data again.