2424
2525namespace livekit {
2626
27- /* *
28- * @brief WebRTC Audio Processing Module (APM) for real-time audio enhancement.
29- *
30- * AudioProcessingModule exposes WebRTC's built-in audio processing capabilities
31- * including echo cancellation, noise suppression, automatic gain control, and
32- * high-pass filtering.
33- *
34- * This class is designed for scenarios where you need explicit control over
35- * audio processing, separate from the built-in processing in AudioSource.
36- *
37- * Typical usage pattern for echo cancellation:
38- * 1. Create an APM with desired features enabled
39- * 2. Call processReverseStream() with speaker/playback audio (reference signal)
40- * 3. Call processStream() with microphone audio (near-end signal)
41- * 4. The processed microphone audio will have echo removed
42- *
43- * Note: Audio frames must be exactly 10ms in duration.
44- */
27+ // / @brief WebRTC Audio Processing Module (APM) for real-time audio enhancement.
28+ // /
29+ // / AudioProcessingModule exposes WebRTC's built-in audio processing capabilities
30+ // / including echo cancellation, noise suppression, automatic gain control, and
31+ // / high-pass filtering.
32+ // /
33+ // / This class is designed for scenarios where you need explicit control over
34+ // / audio processing, separate from the built-in processing in AudioSource.
35+ // /
36+ // / Typical usage pattern for echo cancellation:
37+ // / 1. Create an APM with desired features enabled
38+ // / 2. Call processReverseStream() with speaker/playback audio (reference signal)
39+ // / 3. Call processStream() with microphone audio (near-end signal)
40+ // / 4. The processed microphone audio will have echo removed
41+ // /
42+ // / @note Audio frames must be exactly 10ms in duration.
4543class LIVEKIT_API AudioProcessingModule {
4644public:
47- /* *
48- * @brief Configuration options for the Audio Processing Module.
49- */
45+ // / @brief Configuration options for the Audio Processing Module.
5046 struct Options {
5147 // / Enable acoustic echo cancellation (AEC3).
5248 // / Removes acoustic echo in two-way communication scenarios.
@@ -68,20 +64,16 @@ class LIVEKIT_API AudioProcessingModule {
6864 Options () = default ;
6965 };
7066
71- /* *
72- * @brief Create a new Audio Processing Module with default options (all
73- * disabled).
74- *
75- * @throws std::runtime_error if the APM could not be created.
76- */
67+ // / @brief Create a new Audio Processing Module with default options (all
68+ // / disabled).
69+ // /
70+ // / @throws std::runtime_error if the APM could not be created.
7771 AudioProcessingModule ();
7872
79- /* *
80- * @brief Create a new Audio Processing Module with the specified options.
81- *
82- * @param options Configuration for which processing features to enable.
83- * @throws std::runtime_error if the APM could not be created.
84- */
73+ // / @brief Create a new Audio Processing Module with the specified options.
74+ // /
75+ // / @param options Configuration for which processing features to enable.
76+ // / @throws std::runtime_error if the APM could not be created.
8577 explicit AudioProcessingModule (const Options& options);
8678
8779 virtual ~AudioProcessingModule () = default ;
@@ -94,65 +86,59 @@ class LIVEKIT_API AudioProcessingModule {
9486 AudioProcessingModule (AudioProcessingModule&&) noexcept = default ;
9587 AudioProcessingModule& operator =(AudioProcessingModule&&) noexcept = default ;
9688
97- /* *
98- * @brief Process the forward (near-end/microphone) audio stream.
99- *
100- * This method processes audio captured from the local microphone. It applies
101- * the enabled processing features (noise suppression, gain control, etc.)
102- * and removes echo based on the reference signal provided via
103- * processReverseStream().
104- *
105- * The audio data is modified in-place.
106- *
107- * @param frame The audio frame to process (modified in-place).
108- *
109- * @throws std::runtime_error if processing fails.
110- *
111- * @note The frame must contain exactly 10ms of audio.
112- */
89+ // / @brief Process the forward (near-end/microphone) audio stream.
90+ // /
91+ // / This method processes audio captured from the local microphone. It applies
92+ // / the enabled processing features (noise suppression, gain control, etc.)
93+ // / and removes echo based on the reference signal provided via
94+ // / processReverseStream().
95+ // /
96+ // / The audio data is modified in-place.
97+ // /
98+ // / @param frame The audio frame to process (modified in-place).
99+ // /
100+ // / @throws std::runtime_error if processing fails.
101+ // /
102+ // / @note The frame must contain exactly 10ms of audio.
113103 void processStream (AudioFrame& frame);
114104
115- /* *
116- * @brief Process the reverse (far-end/speaker) audio stream.
117- *
118- * This method provides the reference signal for echo cancellation. Call this
119- * with the audio that is being played through the speakers, so the APM can
120- * learn the acoustic characteristics and remove the echo from the microphone
121- * signal.
122- *
123- * The audio data is modified in-place.
124- *
125- * @param frame The audio frame to process (modified in-place).
126- *
127- * @throws std::runtime_error if processing fails.
128- *
129- * @note The frame must contain exactly 10ms of audio.
130- */
105+ // / @brief Process the reverse (far-end/speaker) audio stream.
106+ // /
107+ // / This method provides the reference signal for echo cancellation. Call this
108+ // / with the audio that is being played through the speakers, so the APM can
109+ // / learn the acoustic characteristics and remove the echo from the microphone
110+ // / signal.
111+ // /
112+ // / The audio data is modified in-place.
113+ // /
114+ // / @param frame The audio frame to process (modified in-place).
115+ // /
116+ // / @throws std::runtime_error if processing fails.
117+ // /
118+ // / @note The frame must contain exactly 10ms of audio.
131119 void processReverseStream (AudioFrame& frame);
132120
133- /* *
134- * @brief Set the estimated delay between the reverse and forward streams.
135- *
136- * This must be called if and only if echo processing is enabled.
137- *
138- * Sets the delay in ms between processReverseStream() receiving a far-end
139- * frame and processStream() receiving a near-end frame containing the
140- * corresponding echo. On the client-side this can be expressed as:
141- *
142- * delay = (t_render - t_analyze) + (t_process - t_capture)
143- *
144- * where:
145- * - t_analyze is the time a frame is passed to processReverseStream() and
146- * t_render is the time the first sample of the same frame is rendered by
147- * the audio hardware.
148- * - t_capture is the time the first sample of a frame is captured by the
149- * audio hardware and t_process is the time the same frame is passed to
150- * processStream().
151- *
152- * @param delay_ms Delay in milliseconds.
153- *
154- * @throws std::runtime_error if setting the delay fails.
155- */
121+ // / @brief Set the estimated delay between the reverse and forward streams.
122+ // /
123+ // / This must be called if and only if echo processing is enabled.
124+ // /
125+ // / Sets the delay in ms between processReverseStream() receiving a far-end
126+ // / frame and processStream() receiving a near-end frame containing the
127+ // / corresponding echo. On the client-side this can be expressed as:
128+ // /
129+ // / delay = (t_render - t_analyze) + (t_process - t_capture)
130+ // /
131+ // / where:
132+ // / - t_analyze is the time a frame is passed to processReverseStream() and
133+ // / t_render is the time the first sample of the same frame is rendered by
134+ // / the audio hardware.
135+ // / - t_capture is the time the first sample of a frame is captured by the
136+ // / audio hardware and t_process is the time the same frame is passed to
137+ // / processStream().
138+ // /
139+ // / @param delay_ms Delay in milliseconds.
140+ // /
141+ // / @throws std::runtime_error if setting the delay fails.
156142 void setStreamDelayMs (int delay_ms);
157143
158144private:
0 commit comments