Server Gateway SDK v3.7.200.21 for Linux Java
Public Member Functions | List of all members
io.agora.rtc.AgoraAudioPcmDataSender Class Reference

Public Member Functions

 AgoraAudioPcmDataSender (long cptr)
native int send (byte[] audio_data, int capture_timestamp, int samples_per_channel, int bytes_per_sample, int number_of_channels, int sample_rate)
void destroy ()

Detailed Description

The AgoraAudioPcmDataSender class.

In scenarios involving custom audio source, you can use the AgoraAudioPcmDataSender class to send PCM audio data directly to the audio track. If the audio track is disabled, the sent audio data is automatically discarded.

Constructor & Destructor Documentation

◆ AgoraAudioPcmDataSender()

io.agora.rtc.AgoraAudioPcmDataSender.AgoraAudioPcmDataSender ( long  cptr)


Member Function Documentation

◆ destroy()

void io.agora.rtc.AgoraAudioPcmDataSender.destroy ( )


◆ send()

native int io.agora.rtc.AgoraAudioPcmDataSender.send ( byte[]  audio_data,
int  capture_timestamp,
int  samples_per_channel,
int  bytes_per_sample,
int  number_of_channels,
int  sample_rate 

Sends the PCM audio data to the local audio track.

audio_dataThe PCM audio data to be sent.
capture_timestampThe time (ms) when the audio sample is captured.
samples_per_channelThe number of audio samples in 10 ms for each audio channel.
bytes_per_sampleThe number of bytes in each sample.
number_of_channelsThe number of audio channels.
sample_rateThe sample rate (Hz). The minimum value is 8000.
  • 0: Success.
  • < 0: Failure.

The documentation for this class was generated from the following file: