LiveKit C++ Client SDK v1.1.0
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
audio_processing_module.h
1/*
2 * Copyright 2025 LiveKit
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <cstdint>
20
21#include "livekit/audio_frame.h"
22#include "livekit/ffi_handle.h"
23#include "livekit/visibility.h"
24
25namespace livekit {
26
43class LIVEKIT_API AudioProcessingModule {
44public:
46 struct Options {
49 bool echo_cancellation = false;
50
53 bool noise_suppression = false;
54
57 bool high_pass_filter = false;
58
61 bool auto_gain_control = false;
62
64 Options() = default;
65 };
66
72
77 explicit AudioProcessingModule(const Options& options);
78
79 virtual ~AudioProcessingModule() = default;
80
81 // Non-copyable
83 AudioProcessingModule& operator=(const AudioProcessingModule&) = delete;
84
85 // Movable
86 AudioProcessingModule(AudioProcessingModule&&) noexcept = default;
87 AudioProcessingModule& operator=(AudioProcessingModule&&) noexcept = default;
88
103 void processStream(AudioFrame& frame);
104
119 void processReverseStream(AudioFrame& frame);
120
142 void setStreamDelayMs(int delay_ms);
143
144private:
146 bool valid() const noexcept { return handle_.valid(); }
147
149 std::uint64_t ffiHandleId() const noexcept { return static_cast<std::uint64_t>(handle_.get()); }
150
151 FfiHandle handle_;
152};
153
154} // namespace livekit
Represents a raw PCM audio frame with interleaved int16 samples.
Definition audio_frame.h:37
WebRTC Audio Processing Module (APM) for real-time audio enhancement.
Definition audio_processing_module.h:43
AudioProcessingModule(const Options &options)
Create a new Audio Processing Module with the specified options.
AudioProcessingModule()
Create a new Audio Processing Module with default options (all disabled).
Public API for the LiveKit C++ Client SDK.
Definition audio_frame.h:25
Configuration options for the Audio Processing Module.
Definition audio_processing_module.h:46
Options()=default
Default constructor.