npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@akiver/csgo-voice-extractor

v2.1.3

Published

CLI to export players' voices from CSGO/CS2 demos into WAV files.

Downloads

91

Readme

Counter-Strike voice extractor

CLI to export players' voices from CSGO/CS2 demos into WAV files.

[!WARNING]
Valve Matchmaking demos do not contain voice audio data, hence there is nothing to extract from MM demos.

Installation

Download the last release for your OS from GitHub.

Usage

Windows

csgove.exe demoPaths... [-output]

By default .dll files are expected to be in the same directory as the executable. You can change it by setting the LD_LIBRARY_PATH environment variable. Example:

LD_LIBRARY_PATH="C:\Users\username\Desktop" csgove.exe

macOS

[!CAUTION]
The environment variable DYLD_LIBRARY_PATH must be set before invoking the program and point to the location of the .dylib files!

DYLD_LIBRARY_PATH=. csgove demoPaths... [-output]

Linux

[!CAUTION]
The environment variable LD_LIBRARY_PATH must be set before invoking the program and point to the location of the .so files!

LD_LIBRARY_PATH=. csgove demoPaths... [-output]

Options

-output <string>

Folder location where audio files will be written. Current working directory by default.

-exit-on-first-error

Stop the program at the first error encountered. By default, the program will continue to the next demo to process if an error occurs.

Examples

Extract voices from the demo myDemo.dem in the current directory:

csgove myDemo.dem

Extract voices from multiple demos using absolute or relative paths:

csgove myDemo1.dem ../myDemo2.dem "C:\Users\username\Desktop\myDemo3.dem"

Change the output location:

csgove -output "C:\Users\username\Desktop\output" myDemo.dem

Developing

Requirements

Debugging is easier on macOS/Linux 64-bit, see warnings below.

Windows

Because the CSGO audio library is a 32-bit DLL, you need a 32-bit GCC and set the Go env variable GOARCH=386 to build the program.

[!IMPORTANT]
Use a unix like shell such as Git Bash, it will not work with cmd.exe!

[!WARNING]
The $GCC_PATH variable in the following steps is the path where gcc.exe is located.
By default, it's C:\TDM-GCC-64\bin when using TDM-GCC (highly recommended).

  1. Install GCC for Windows, TDM-GCC is recommended because it handles both 32-bit and 64-bit when running go build. If you use MSYS2, it's important to install the 32-bit version (pacman -S mingw-w64-i686-gcc).
  2. Install pkg-config using chocolatey by running choco install pkgconfiglite.
    It's highly recommended to use choco otherwise you would have to build pkg-config and copy/paste the pkg-config.exe binary in your $GCC_PATH.
  3. Download the source code of Opus
  4. Extract the archive, rename the folder to opus and place it in the project's root folder
  5. Open the opus/win32/VS2015/opus.sln file with Visual Studio (upgrade the project if asked)
  6. Build the Release configuration for Win32 (not x64 - it's important to build the 32-bit version!)
  7. Copy/paste the opus.dll file in $GCC_PATH and dist/bin/win32-x64
  8. Copy/paste the C header files located inside the include folder file in $GCC_PATH\include\opus (create the folders if needed)
  9. Copy/paste the opus.pc.example to opus.pc file and edit the prefix variable to match your GCC installation path if necessary.
  10. PKG_CONFIG_PATH=$(realpath .) LD_LIBRARY_PATH=dist/bin/win32-x64 CGO_ENABLED=1 GOARCH=386 go run -tags nolibopusfile .

[!WARNING]
Because the Go debugger doesn't support Windows 32-bit and the CSGO lib is a 32-bit DLL, you will not be able to run the Go debugger.
If you want to be able to run the debugger for the Go part only, you could comment on lines that involve C/CGO calls.

macOS

[!IMPORTANT]
On macOS ARM64, the x64 version of Homebrew must be installed!
You can install it by adding arch -x86_64 before the official command to install Homebrew (arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)")

  1. Install Homebrew x64 version
  2. arch -x86_64 brew install opus
  3. arch -x86_64 brew install pkg-config
  4. cp /usr/local/Cellar/opus/1.4/lib/libopus.0.dylib dist/bin/darwin-x64 (arch -x86_64 brew info opus to get the path)
  5. DYLD_LIBRARY_PATH=dist/bin/darwin-x64 CGO_ENABLED=1 GOARCH=amd64 go run -tags nolibopusfile .

[!WARNING]
On macOS ARM64, the Go debugger breakpoints will not work because the executable must target amd64 but your OS is ARM64.

Linux

  1. sudo apt install pkg-config libopus-dev
  2. cp /usr/lib/x86_64-linux-gnu/libopus.so.0 dist/bin/linux-x64 (you may need to change the path depending on your distro)
  3. LD_LIBRARY_PATH=dist/bin/linux-x64 CGO_ENABLED=1 GOARCH=amd64 go run -tags nolibopusfile .

Building

Windows

make build-windows

macOS

make build-darwin

Linux

make build-linux

Credits

Thanks to @saul and @ericek111 for their CSGO investigation.
Thanks to @DandrewsDev for his work on CS2 voice data extraction.

License

MIT