Agora Server Gateway SDK Java API Reference
Loading...
Searching...
No Matches
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)
 
int sendAudioPcmData (AudioFrame audioFrame)
 
synchronized 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)

Constructor.

Member Function Documentation

◆ destroy()

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

Destructor.

◆ 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.

Deprecated
Use sendAudioPcmData instead.
Parameters
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.
Returns
  • 0: Success.
  • < 0: Failure.

◆ sendAudioPcmData()

int io.agora.rtc.AgoraAudioPcmDataSender.sendAudioPcmData ( AudioFrame audioFrame)

Sends the PCM audio data to the local audio track.

Parameters
audioFrameThe audio frame: AudioFrame.
Returns
The result of sending the PCM audio data.

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