Agora Server Gateway SDK C++ API Reference
NGIAgoraAudioTrack.h
Go to the documentation of this file.
1
2// Copyright (c) 2018 Agora.io. All rights reserved
3
4// This program is confidential and proprietary to Agora.io.
5// And may not be copied, reproduced, modified, disclosed to others, published
6// or used, in whole or in part, without the express prior written permission
7// of Agora.io.
8
9#pragma once // NOLINT(build/header_guard)
10
11#include "AgoraBase.h"
12
13// FIXME(Ender): use this class instead of AudioSendStream as local track
14namespace agora {
15namespace rtc {
16class IAudioTrackStateObserver;
17class IAudioSinkBase;
28
30 size_t channels;
31
33 channels(0) {}
34 AudioSinkWants(int sampleRate, size_t chs) : samplesPerSec(sampleRate),
35 channels(chs) {}
36};
37
41class IAudioTrack : public RefCountInterface {
42public:
75 };
76
77 public:
79
87 virtual int adjustPlayoutVolume(int volume, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
88
96 virtual int getPlayoutVolume(int* volume) = 0;
98
108 virtual bool addAudioSink(agora_refptr<IAudioSinkBase> sink, const AudioSinkWants& wants, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
109
119 virtual bool removeAudioSink(agora_refptr<IAudioSinkBase> sink, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
120};
121
126 public:
134 uint32_t source_id;
165 uint32_t effect_type;
167
170 uint32_t hw_ear_monitor;
172
176
180 uint32_t audio_volume; // [0,255]
181
189 effect_type(0),
190 hw_ear_monitor(0),
191 enabled(false),
192 audio_volume(0) {}
193 };
194
195 public:
206 virtual void setEnabled(bool enable, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
207
214 virtual bool isEnabled() const = 0;
215
221
227
237 virtual int adjustPublishVolume(int volume, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
238
246 virtual int getPublishVolume(int* volume) = 0;
247
249
259 virtual int enableLocalPlayback(bool enable, bool sync = true, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
272 virtual int enableEarMonitor(bool enable, int includeAudioFilters, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
274
275
290 virtual void setMaxBufferedAudioFrameNumber(int number, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
291
302 virtual int ClearSenderBuffer() = 0;
303
316 virtual void setAudioFrameSendDelayMs(int32_t delay_ms) = 0;
317
318 protected:
320};
321
373
376 int mean_waiting_time;
380 size_t expanded_speech_samples;
384 size_t expanded_noise_samples;
388 uint32_t timestamps_since_last_report;
392 uint16_t min_sequence_number;
396 uint16_t max_sequence_number;
400 int32_t audio_level;
404 uint32_t downlink_process_time_ms;
405
406 uint32_t target_level_base_ms;
407 uint32_t target_level_prefered_ms;
409
432 uint32_t mos_value;
451 int32_t e2e_delay_ms;
453
455 uid(0),
456 quality(0),
460 num_channels(0),
464 frozen_rate(0),
466 mean_waiting_time(0),
467 expanded_speech_samples(0),
468 expanded_noise_samples(0),
469 timestamps_since_last_report(0),
470 min_sequence_number(0xFFFF),
471 max_sequence_number(0),
472 audio_level(0),
473 downlink_process_time_ms(0),
479 mos_value(0),
482 e2e_delay_ms(0){ }
483};
484
489 public:
497 virtual bool getStatistics(RemoteAudioTrackStats& stats) = 0;
498
504
506
515 virtual int enableSoundPositionIndication(bool enabled) = 0;
516
529 virtual int setRemoteVoicePosition(float pan, float gain) = 0;
530
541 virtual int enableSpatialAudio(bool enabled, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
542
552 virtual int setRemoteUserSpatialAudioParams(const agora::SpatialAudioParams& params, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
554};
555
556} // namespace rtc
557} // namespace agora
Definition: NGIAgoraAudioTrack.h:41
virtual bool removeAudioSink(agora_refptr< IAudioSinkBase > sink, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool addAudioSink(agora_refptr< IAudioSinkBase > sink, const AudioSinkWants &wants, aosl_ref_t ares=AOSL_REF_INVALID)=0
AudioFilterPosition
Definition: NGIAgoraAudioTrack.h:46
@ PcmSource
Definition: NGIAgoraAudioTrack.h:62
@ PostAudioProcessing
Definition: NGIAgoraAudioTrack.h:54
@ PcmSourceSending
Definition: NGIAgoraAudioTrack.h:66
@ RemoteMixedPlayback
Definition: NGIAgoraAudioTrack.h:74
@ RemoteUserPlayback
Definition: NGIAgoraAudioTrack.h:58
@ RecordingLocalPlayback
Definition: NGIAgoraAudioTrack.h:50
@ PcmSourceLocalPlayback
Definition: NGIAgoraAudioTrack.h:70
Definition: NGIAgoraAudioTrack.h:125
virtual int getPublishVolume(int *volume)=0
virtual void setMaxBufferedAudioFrameNumber(int number, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool isEnabled() const =0
virtual int adjustPublishVolume(int volume, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual void setAudioFrameSendDelayMs(int32_t delay_ms)=0
virtual void setEnabled(bool enable, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int ClearSenderBuffer()=0
~ILocalAudioTrack()
Definition: NGIAgoraAudioTrack.h:319
virtual LOCAL_AUDIO_STREAM_STATE getState()=0
virtual LocalAudioTrackStats GetStats()=0
Definition: NGIAgoraAudioTrack.h:488
virtual bool getStatistics(RemoteAudioTrackStats &stats)=0
virtual REMOTE_AUDIO_STATE getState()=0
LOCAL_AUDIO_STREAM_STATE
Definition: AgoraBase.h:2735
REMOTE_AUDIO_STATE
Definition: AgoraBase.h:2843
unsigned int uid_t
Definition: AgoraMediaBase.h:25
Definition: AgoraBase.h:86
Definition: NGIAgoraAudioTrack.h:25
AudioSinkWants()
Definition: NGIAgoraAudioTrack.h:32
AudioSinkWants(int sampleRate, size_t chs)
Definition: NGIAgoraAudioTrack.h:34
int samplesPerSec
Definition: NGIAgoraAudioTrack.h:27
size_t channels
Definition: NGIAgoraAudioTrack.h:30
Definition: NGIAgoraAudioTrack.h:130
uint32_t audio_volume
Definition: NGIAgoraAudioTrack.h:180
uint32_t sent_audio_frames
Definition: NGIAgoraAudioTrack.h:149
uint32_t missed_audio_frames
Definition: NGIAgoraAudioTrack.h:145
uint32_t buffered_pcm_data_list_size
Definition: NGIAgoraAudioTrack.h:141
uint32_t playout_audio_frames
Definition: NGIAgoraAudioTrack.h:161
LocalAudioTrackStats()
Definition: NGIAgoraAudioTrack.h:182
uint32_t dropped_audio_frames
Definition: NGIAgoraAudioTrack.h:157
uint32_t source_id
Definition: NGIAgoraAudioTrack.h:134
bool enabled
Definition: NGIAgoraAudioTrack.h:175
uint32_t pushed_audio_frames
Definition: NGIAgoraAudioTrack.h:153
uint32_t effect_type
Definition: NGIAgoraAudioTrack.h:165
Definition: NGIAgoraAudioTrack.h:325
uint16_t frozen_count_200_ms
Definition: NGIAgoraAudioTrack.h:420
uid_t uid
Definition: NGIAgoraAudioTrack.h:329
uint16_t frozen_time_200_ms
Definition: NGIAgoraAudioTrack.h:424
int received_bitrate
Definition: NGIAgoraAudioTrack.h:357
uint32_t delay_estimate_ms
Definition: NGIAgoraAudioTrack.h:428
int network_transport_delay
Definition: NGIAgoraAudioTrack.h:337
int32_t quality_changed_reason
Definition: NGIAgoraAudioTrack.h:449
int frozen_rate
Definition: NGIAgoraAudioTrack.h:367
uint32_t mos_value
Definition: NGIAgoraAudioTrack.h:432
NODOC uint16_t frozen_count_80_ms
Definition: NGIAgoraAudioTrack.h:412
int total_frozen_time
Definition: NGIAgoraAudioTrack.h:363
uint32_t jitter_buffer_delay
Definition: NGIAgoraAudioTrack.h:341
RemoteAudioTrackStats()
Definition: NGIAgoraAudioTrack.h:454
int audio_loss_rate
Definition: NGIAgoraAudioTrack.h:345
uint16_t frozen_time_80_ms
Definition: NGIAgoraAudioTrack.h:416
int received_sample_rate
Definition: NGIAgoraAudioTrack.h:353
uint64_t publish_duration
Definition: NGIAgoraAudioTrack.h:441
int qoe_quality
Definition: NGIAgoraAudioTrack.h:445
int quality
Definition: NGIAgoraAudioTrack.h:333
uint64_t total_active_time
Definition: NGIAgoraAudioTrack.h:437
int64_t received_bytes
Definition: NGIAgoraAudioTrack.h:371
int num_channels
Definition: NGIAgoraAudioTrack.h:349