Example code for exporting players voices from CS2 demos into WAV files.
Valve Matchmaking demos do not contain voice audio data, as such there is nothing to extract from MM demo files.
The intention of this project is not to be an end user tool for bulk or batch processing demos and extracting voice data.
However, this should serve as a guideline for how to process the audio data as pulled by demoinfocs-golang. People using that tool to process their demos who wish to also pull voice data can leverage this sample to build that audio processing into their demo processing tools.
- Install Go 1.26.2 or newer.
- Install the native Opus dependencies for your OS.
- Copy
.envwith your Faceit keys if you want Faceit lookup/download support:FACEIT_API_KEY=... FACEIT_DOWNLOAD_API_KEY=... API_KEY=...
- Start the web app:
go run . - Open
http://localhost:9000.
The app writes uploaded demos to upload/ and extracted audio/metadata to output/.
This project uses cgo through gopkg.in/hraban/opus.v2, so Go alone is not enough for audio extraction. You also need a C compiler, pkg-config, and the Opus development libraries.
Linux:
sudo apt-get install build-essential pkg-config libopus-dev libopusfile-devMac:
brew install pkg-config opus opusfileWindows:
- Go can run the server, but audio extraction needs a Windows cgo toolchain plus Opus headers/libs.
- The easiest production path is still building/running on Linux, or testing the full audio path on the VPS.
make build-vpsOn the VPS, install the Linux dependencies above before running the binary.
Thanks to @rumblefrog for all their help in getting this working. Check out this excellent blog post about Reversing Steam Voice Codec and their work on Source Chat Relay
This sample relies on demoinfocs-golang. Thank you to @markus-wa, @akiver and all the contributors there.
Special thanks to @DandrewsDev for providing the CS2VoiceData code that made this project possible.