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
86 virtual int adjustPlayoutVolume(int volume) = 0;
87
95 virtual int getPlayoutVolume(int* volume) = 0;
97
106 virtual bool addAudioSink(agora_refptr<IAudioSinkBase> sink, const AudioSinkWants& wants) = 0;
107
116 virtual bool removeAudioSink(agora_refptr<IAudioSinkBase> sink) = 0;
117};
118
123 public:
131 uint32_t source_id;
162 uint32_t effect_type;
164
167 uint32_t hw_ear_monitor;
169
173
177 uint32_t audio_volume; // [0,255]
178
186 effect_type(0),
187 hw_ear_monitor(0),
188 enabled(false),
189 audio_volume(0) {}
190 };
191
192 public:
202 virtual void setEnabled(bool enable) = 0;
203
210 virtual bool isEnabled() const = 0;
211
217
223
232 virtual int adjustPublishVolume(int volume) = 0;
233
241 virtual int getPublishVolume(int* volume) = 0;
242
244
253 virtual int enableLocalPlayback(bool enable) = 0;
265 virtual int enableEarMonitor(bool enable, int includeAudioFilters) = 0;
267 protected:
269};
270
322
325 int mean_waiting_time;
329 size_t expanded_speech_samples;
333 size_t expanded_noise_samples;
337 uint32_t timestamps_since_last_report;
341 uint16_t min_sequence_number;
345 uint16_t max_sequence_number;
349 int32_t audio_level;
353 uint32_t downlink_process_time_ms;
354
355 uint32_t target_level_base_ms;
356 uint32_t target_level_prefered_ms;
358
381 uint32_t mos_value;
400 int32_t e2e_delay_ms;
402
404 uid(0),
405 quality(0),
409 num_channels(0),
413 frozen_rate(0),
415 mean_waiting_time(0),
416 expanded_speech_samples(0),
417 expanded_noise_samples(0),
418 timestamps_since_last_report(0),
419 min_sequence_number(0xFFFF),
420 max_sequence_number(0),
421 audio_level(0),
422 downlink_process_time_ms(0),
428 mos_value(0),
431 e2e_delay_ms(0){ }
432};
433
438 public:
446 virtual bool getStatistics(RemoteAudioTrackStats& stats) = 0;
447
453
455
464 virtual int enableSoundPositionIndication(bool enabled) = 0;
465
478 virtual int setRemoteVoicePosition(float pan, float gain) = 0;
479
489 virtual int enableSpatialAudio(bool enabled) = 0;
490
499 virtual int setRemoteUserSpatialAudioParams(const agora::SpatialAudioParams& params) = 0;
501};
502
503} // namespace rtc
504} // namespace agora
Definition: NGIAgoraAudioTrack.h:41
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
virtual bool addAudioSink(agora_refptr< IAudioSinkBase > sink, const AudioSinkWants &wants)=0
virtual bool removeAudioSink(agora_refptr< IAudioSinkBase > sink)=0
Definition: NGIAgoraAudioTrack.h:122
virtual void setEnabled(bool enable)=0
virtual int adjustPublishVolume(int volume)=0
virtual int getPublishVolume(int *volume)=0
virtual bool isEnabled() const =0
~ILocalAudioTrack()
Definition: NGIAgoraAudioTrack.h:268
virtual LOCAL_AUDIO_STREAM_STATE getState()=0
virtual LocalAudioTrackStats GetStats()=0
Definition: NGIAgoraAudioTrack.h:437
virtual bool getStatistics(RemoteAudioTrackStats &stats)=0
virtual REMOTE_AUDIO_STATE getState()=0
LOCAL_AUDIO_STREAM_STATE
Definition: AgoraBase.h:2731
REMOTE_AUDIO_STATE
Definition: AgoraBase.h:2839
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:127
uint32_t audio_volume
Definition: NGIAgoraAudioTrack.h:177
uint32_t sent_audio_frames
Definition: NGIAgoraAudioTrack.h:146
uint32_t missed_audio_frames
Definition: NGIAgoraAudioTrack.h:142
uint32_t buffered_pcm_data_list_size
Definition: NGIAgoraAudioTrack.h:138
uint32_t playout_audio_frames
Definition: NGIAgoraAudioTrack.h:158
LocalAudioTrackStats()
Definition: NGIAgoraAudioTrack.h:179
uint32_t dropped_audio_frames
Definition: NGIAgoraAudioTrack.h:154
uint32_t source_id
Definition: NGIAgoraAudioTrack.h:131
bool enabled
Definition: NGIAgoraAudioTrack.h:172
uint32_t pushed_audio_frames
Definition: NGIAgoraAudioTrack.h:150
uint32_t effect_type
Definition: NGIAgoraAudioTrack.h:162
Definition: NGIAgoraAudioTrack.h:274
uint16_t frozen_count_200_ms
Definition: NGIAgoraAudioTrack.h:369
uid_t uid
Definition: NGIAgoraAudioTrack.h:278
uint16_t frozen_time_200_ms
Definition: NGIAgoraAudioTrack.h:373
int received_bitrate
Definition: NGIAgoraAudioTrack.h:306
uint32_t delay_estimate_ms
Definition: NGIAgoraAudioTrack.h:377
int network_transport_delay
Definition: NGIAgoraAudioTrack.h:286
int32_t quality_changed_reason
Definition: NGIAgoraAudioTrack.h:398
int frozen_rate
Definition: NGIAgoraAudioTrack.h:316
uint32_t mos_value
Definition: NGIAgoraAudioTrack.h:381
NODOC uint16_t frozen_count_80_ms
Definition: NGIAgoraAudioTrack.h:361
int total_frozen_time
Definition: NGIAgoraAudioTrack.h:312
uint32_t jitter_buffer_delay
Definition: NGIAgoraAudioTrack.h:290
RemoteAudioTrackStats()
Definition: NGIAgoraAudioTrack.h:403
int audio_loss_rate
Definition: NGIAgoraAudioTrack.h:294
uint16_t frozen_time_80_ms
Definition: NGIAgoraAudioTrack.h:365
int received_sample_rate
Definition: NGIAgoraAudioTrack.h:302
uint64_t publish_duration
Definition: NGIAgoraAudioTrack.h:390
int qoe_quality
Definition: NGIAgoraAudioTrack.h:394
int quality
Definition: NGIAgoraAudioTrack.h:282
uint64_t total_active_time
Definition: NGIAgoraAudioTrack.h:386
int64_t received_bytes
Definition: NGIAgoraAudioTrack.h:320
int num_channels
Definition: NGIAgoraAudioTrack.h:298