Commit 4331231
Changed files (3)
CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.30)
-project(webrtcAGC
+project(audioProcessor
VERSION 1.0.0
- DESCRIPTION "WebRTC AudioGainControl"
+ DESCRIPTION "Audio Gain Controller using WebRTC - GainController2"
LANGUAGES CXX
)
@@ -15,9 +15,9 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/W4)
endif()
-add_executable(webrtcAGC src/main.cpp src/audioProcessor.cpp)
+add_executable(audioProcessor src/main.cpp src/audioProcessor.cpp)
add_definitions(-DWEBRTC_APM_DEBUG_DUMP=0)
-target_include_directories(webrtcAGC PRIVATE src/ thirdparty/agc/include thirdparty/agc/include/webrtc thirdparty/agc/include/webrtc/modules/audio_processing)
-target_link_directories(webrtcAGC PRIVATE thirdparty/agc/lib)
-target_link_libraries(webrtcAGC PRIVATE webrtc-audio-processing-2)
+target_include_directories(audioProcessor PRIVATE src/ thirdparty/agc/include thirdparty/agc/include/webrtc thirdparty/agc/include/webrtc/modules/audio_processing)
+target_link_directories(audioProcessor PRIVATE thirdparty/agc/lib)
+target_link_libraries(audioProcessor PRIVATE webrtc-audio-processing-2)
Notes.md → notes.md
File renamed without changes
readme.md
@@ -0,0 +1,54 @@
+# Audio Gain Control (AGC - WebRTC)
+
+## Overview
+This project provides a simple tool for processing audio files with features like:
+- **Automatic Gain Control (AGC):** Dynamically adjusts the volume of the audio to ensure consistent levels using WebRTC's GainController2.
+- **Custom Resampling:** Converts audio to a desired sample rate (e.g., 48000 Hz) - using linear interpolation for resampling.
+- **Flexible Input/Output:** Supports reading and writing raw audio files, with optional integration of FFmpeg for advanced audio handling.
+
+## How It Works
+1. **Audio Input:**
+ - Reads raw PCM audio from a file or uses FFmpeg for format decoding.
+2. **Processing:**
+ - Applies AGC using WebRTC's GainController2.
+ - Optionally resamples the audio to a specified sample rate.
+3. **Audio Output:**
+ - Writes processed audio to a raw PCM file or uses FFmpeg for encoding.
+
+### Build Instructions
+1. Ensure you have a C++ compiler that supports C++17 or later and cmake installed.
+2. Clone the repository:
+ ```bash
+ git clone <repository_url>
+ cd <repository_folder>
+ ```
+3. Initialize the thirdparty agc libs and make sure to have meson and ninja installed.
+ ```bash
+ cd thirdparty
+ sh install.sh
+ ```
+3. Check the agc/libs folder consist of .so or .a files. If they are present inside x86_64-linux-gnu folder, get them out and place them in the agc/libs folder. Once done,you can go back to the root folder and continue with the build process.
+
+4. Compile the code:
+ ```bash
+ cmake -S . -B build
+ cmake --build build
+ ```
+
+### Running the Program
+To process an audio file, use the following command:
+```bash
+./bin/audioProcessor <input_file> <output_file>
+```
+- `<input_file>`: Path to the raw PCM input file (with a WAV header).
+- `<output_file>`: Path to the processed raw PCM output file.
+
+## Dependencies
+- **C++17:** For modern C++ features.
+- **CMake:** For building the project.
+- **Meson and Ninja:** For building the thirdparty agc libs.
+- **WebRTC:** For GainController2 and audio buffer management.
+- **FFmpeg (optional):** For reading and writing non-raw audio formats.
+
+## Contributing
+Feel free to open issues or submit pull requests for enhancements or bug fixes.
\ No newline at end of file