This document describes how to build the AudioCapture application.
Before building, ensure you have the following installed:
-
Visual Studio 2022 (or Visual Studio 2019)
- Install the "Desktop development with C++" workload
- Download from: https://visualstudio.microsoft.com/
-
CMake (version 3.15 or later)
- Download from: https://cmake.org/download/
- Make sure it's installed at
C:\Program Files\CMake\bin\cmake.exe - Or update the path in the build scripts
-
vcpkg (C++ package manager)
- Clone from: https://github.com/Microsoft/vcpkg
- Recommended location:
C:\vcpkg - Bootstrap vcpkg:
.\vcpkg\bootstrap-vcpkg.bat
-
Required packages via vcpkg:
vcpkg install libflac:x64-windows vcpkg install opus:x64-windows vcpkg install ogg:x64-windows vcpkg install nlohmann-json:x64-windows
Simply double-click build.bat
The script will:
- Create the build directory if needed
- Configure CMake with vcpkg
- Build the Release configuration
- Copy the executable to the
packagefolder - Copy required DLLs (opus.dll, ogg.dll, FLAC.dll, FLAC++.dll) to the
packagefolder
-
Create build directory:
mkdir build cd build
-
Configure CMake:
"C:\Program Files\CMake\bin\cmake.exe" .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-
Build the project:
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release --target AudioCapture -
Copy files to package:
copy bin\Release\AudioCapture.exe ..\package\AudioCapture.exe copy C:\vcpkg\installed\x64-windows\bin\opus.dll ..\package\opus.dll copy C:\vcpkg\installed\x64-windows\bin\ogg.dll ..\package\ogg.dll copy C:\vcpkg\installed\x64-windows\bin\FLAC.dll ..\package\FLAC.dll copy C:\vcpkg\installed\x64-windows\bin\FLAC++.dll ..\package\FLAC++.dll
After a successful build, you'll find:
package\AudioCapture.exe- The main applicationpackage\opus.dll- Opus codec librarypackage\ogg.dll- Ogg container librarypackage\FLAC.dll- FLAC codec librarypackage\FLAC++.dll- FLAC C++ wrapper library
You can run the application directly from the package folder.
After building, you can create a distributable package:
- Double-click
package.bat
This will:
- Create a
dist\AudioCapture-v1.0.0folder with all necessary files - Include the executable, DLLs, and documentation
- Create a ZIP archive for easy distribution
- Generate a README.txt with usage instructions
The package includes:
- AudioCapture.exe
- opus.dll, ogg.dll, FLAC.dll, and FLAC++.dll
- README.txt (user instructions)
- LICENSE.txt (if available)
- AudioCaptures\ (default output folder)
To remove all build artifacts and start fresh:
- Double-click
clean.batto delete the build directory
- Verify CMake is installed at
C:\Program Files\CMake\bin\cmake.exe - Or update the path in the build scripts to match your installation
- Verify vcpkg is installed at
C:\vcpkg - Or update
CMAKE_TOOLCHAIN_FILEpath in the build scripts - Make sure you've run
bootstrap-vcpkg.batin the vcpkg directory
- Ensure all required packages are installed via vcpkg:
vcpkg list
- If missing, install them:
vcpkg install libflac:x64-windows opus:x64-windows ogg:x64-windows nlohmann-json:x64-windows
- Make sure you have Visual Studio 2022 with C++ development tools
- Try cleaning and rebuilding: run
clean.batthenbuild.bat - Check that all prerequisites are installed correctly
If vcpkg is installed in a different location, update the following in build.bat and build-ci.bat:
-DCMAKE_TOOLCHAIN_FILE=C:/your/path/to/vcpkg/scripts/buildsystems/vcpkg.cmakeAnd in package.bat update the DLL paths:
C:\your\path\to\vcpkg\installed\x64-windows\bin\opus.dll
C:\your\path\to\vcpkg\installed\x64-windows\bin\ogg.dll
C:\your\path\to\vcpkg\installed\x64-windows\bin\FLAC.dll
C:\your\path\to\vcpkg\installed\x64-windows\bin\FLAC++.dllTo build a debug version with debugging symbols, modify the build command:
"C:\Program Files\CMake\bin\cmake.exe" --build build --config Debug --target AudioCaptureThe debug executable will be at build\bin\Debug\AudioCapture.exe
- OS: Windows 10 Build 19045 or later (tested and working)
- Build 20348+ recommended for optimal per-process audio capture
- Architecture: x64 (64-bit)
- Compiler: MSVC 2019 or later