audio_options.h (2991B)
1 /* 2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef API_AUDIO_OPTIONS_H_ 12 #define API_AUDIO_OPTIONS_H_ 13 14 #include <optional> 15 #include <string> 16 17 #include "rtc_base/system/rtc_export.h" 18 19 namespace webrtc { 20 21 // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine. 22 // Used to be flags, but that makes it hard to selectively apply options. 23 // We are moving all of the setting of options to structs like this, 24 // but some things currently still use flags. 25 struct RTC_EXPORT AudioOptions { 26 AudioOptions(); 27 ~AudioOptions(); 28 void SetAll(const AudioOptions& change); 29 30 bool operator==(const AudioOptions& o) const; 31 bool operator!=(const AudioOptions& o) const { return !(*this == o); } 32 33 std::string ToString() const; 34 35 // Audio processing that attempts to filter away the output signal from 36 // later inbound pickup. 37 std::optional<bool> echo_cancellation; 38 #if defined(WEBRTC_IOS) 39 // Forces software echo cancellation on iOS. This is a temporary workaround 40 // (until Apple fixes the bug) for a device with non-functioning AEC. May 41 // improve performance on that particular device, but will cause unpredictable 42 // behavior in all other cases. See http://bugs.webrtc.org/8682. 43 std::optional<bool> ios_force_software_aec_HACK; 44 #endif 45 // Audio processing to adjust the sensitivity of the local mic dynamically. 46 std::optional<bool> auto_gain_control; 47 // Audio processing to filter out background noise. 48 std::optional<bool> noise_suppression; 49 // Audio processing to remove background noise of lower frequencies. 50 std::optional<bool> highpass_filter; 51 // Audio processing to swap the left and right channels. 52 std::optional<bool> stereo_swapping; 53 // Audio receiver jitter buffer (NetEq) max capacity in number of packets. 54 std::optional<int> audio_jitter_buffer_max_packets; 55 // Audio receiver jitter buffer (NetEq) fast accelerate mode. 56 std::optional<bool> audio_jitter_buffer_fast_accelerate; 57 // Audio receiver jitter buffer (NetEq) minimum target delay in milliseconds. 58 std::optional<int> audio_jitter_buffer_min_delay_ms; 59 // Enable audio network adaptor. 60 // TODO(webrtc:11717): Remove this API in favor of adaptivePtime in 61 // RtpEncodingParameters. 62 std::optional<bool> audio_network_adaptor; 63 // Config string for audio network adaptor. 64 std::optional<std::string> audio_network_adaptor_config; 65 // Pre-initialize the ADM for recording when starting to send. Default to 66 // true. 67 // TODO(webrtc:13566): Remove this option. See issue for details. 68 std::optional<bool> init_recording_on_send; 69 }; 70 71 } // namespace webrtc 72 73 74 #endif // API_AUDIO_OPTIONS_H_