This is an example of how to use the demoinfocs-golang library to capture voice chat in CELT format.
You need to have the following installed:
- Linux (macOS or WSL may work, but are not tested)
- CS:GO Linux Binaries
- CELT - Audio Codec Library
- Sox - Sound Processing Tools (for playback and conversion to
.wav
)
Valve Matchmaking demos do not record voice audio data, and as such this can't be extracted from MM demos.
Adjust the paths in the below example before running.
STEAM_LIBRARY="..." # <--- insert path to steam library here
CSGO_BIN="$STEAM_LIBRARY/steamapps/common/Counter-Strike Global Offensive/bin/linux64"
export CGO_LDFLAGS="-L \"$CSGO_BIN\" -l:vaudio_celt_client.so"
export LD_LIBRARY_PATH="$CSGO_BIN:$LD_LIBRARY_PATH"
go run capture_voice.go -demo /path/to/demo.dem # <--- replace with your demo
This will create a different files in an out/
directory. Each file is a separate sequence of voice audio.
With Sox installed, you can play these files back via the following command (replace 1 with the sequence to play back):
play -t raw -r 22050 -e signed -b 16 -c 1 out/1.celt
Or convert it to .wav
via:
sox -t raw -r 22050 -e signed -b 16 -c 1 -L out/1.celt out/1.wav
Thanks to @ericek111 for this gist