LinuxCommandLibrary

vgmstream_cli

Convert game audio files to playable formats

TLDR

Decode an adc file to wav. (Default output name is input.wav)

$ vgmstream_cli [path/to/input.adc] -o [path/to/output.wav]
copy

Print metadata without decoding the audio
$ vgmstream_cli [path/to/input.adc] -m
copy

Decode an audio file without loops
$ vgmstream_cli [path/to/input.adc] -o [path/to/output.wav] -i
copy

Decode with three loops, then add a 3s delay followed by a 5s fadeout
$ vgmstream_cli [path/to/input.adc] -o [path/to/output.wav] -l [3.0] -f [5.0] -d [3.0]
copy

Convert multiple files to bgm_(original name).wav (Default -o pattern is ?f.wav)
$ vgmstream_cli -o [path/to/bgm_?f.wav] [path/to/file1.adc path/to/file2.adc ...]
copy

Play the file looping endlessly (channels and rate must match metadata)
$ vgmstream_cli [path/to/input.adc] -pec | aplay --format cd --channels [1] --rate [44100]
copy

SYNOPSIS

vgmstream_cli [OPTIONS] INPUT_FILE [OUTPUT_FILE]

PARAMETERS

INPUT_FILE
    The path to the video game audio file to be processed. This is a mandatory argument.

OUTPUT_FILE
    The path where the decoded audio will be saved. If omitted, the command typically outputs to standard output (stdout), which can then be piped to another player (e.g., aplay) or a file. This argument is only used for conversion.

-o FILE
    Specifies the output file path. Equivalent to providing OUTPUT_FILE directly as the second argument.

-p
    Plays the decoded audio directly to the system's default audio device (via aplay or similar backend). No output file is created.

-s STREAM_INDEX
    Selects a specific audio stream within a multi-stream input file. Some game formats contain multiple tracks or variations.

-l LOOP_COUNT
    Loops the audio track a specified number of times. Use 0 for infinite looping, 1 for no looping (play once).

-f
    Forces overwrite of the output file if it already exists, without prompting for confirmation.

-m
    Prints detailed metadata about the input file to standard output, including track duration, sample rate, channels, and loop points, without decoding the audio.

--tags
    Shows tag information (if available) for the input file, such as title, artist, or album.

--loop-silence
    Adds a short period of silence after each loop when looping is enabled, preventing abrupt transitions.

--decode-samples NUM_SAMPLES
    Decodes only a specified number of samples from the input file. Useful for debugging or extracting short segments.

--raw
    Outputs raw PCM audio data to standard output, without any header. Useful for piping to tools that expect raw audio.

--help
    Displays a help message with available options and their descriptions.

--version
    Prints the version information of vgmstream_cli.

DESCRIPTION

vgmstream_cli is the command-line interface for the vgmstream library, a powerful tool designed to decode and play a vast array of proprietary audio formats commonly found in video games. Unlike standard media players that focus on general-purpose audio/video formats, vgmstream_cli specializes in the often complex and unique sound formats specific to game consoles and PC games. It can be used to play these files directly through an audio output device or, more commonly, to convert them into standard formats like WAV or Ogg Vorbis for broader compatibility and editing. Its primary utility lies in making otherwise inaccessible game music available for listening, archiving, or further processing.

CAVEATS

Due to the diverse and often undocumented nature of video game audio formats, vgmstream_cli may not support every existing format, or some formats may have partial support. Compatibility is continuously updated, but users may encounter files that cannot be decoded. Performance can vary depending on the complexity of the format and the system's hardware. Additionally, direct playback (-p option) often relies on external tools like aplay, which must be installed and configured correctly on the system.

COMMON USE CASES

Conversion: Converting game music into standard WAV or Ogg Vorbis files for use in other applications or for archival purposes.
Direct Playback: Quickly listening to a game music track without needing a dedicated player plugin.
Metadata Extraction: Examining the internal structure and properties of game audio files for research or development.
Looping Audio: Creating endlessly looping background music for custom projects or streams by utilizing the loop functionality.

INSTALLATION

vgmstream_cli is typically available in the package repositories of many Linux distributions (e.g., Debian/Ubuntu: sudo apt install vgmstream, Arch Linux: sudo pacman -S vgmstream). Alternatively, it can be compiled from source by downloading the vgmstream project from its official GitHub repository.

HISTORY

The vgmstream project began as a dedicated effort by developers, notably 'hcs', to address the lack of support for proprietary video game audio formats in general-purpose media players. Over time, it evolved into a comprehensive library capable of handling hundreds of obscure and complex formats from various game consoles and PC games. vgmstream_cli emerged as the command-line frontend, providing a versatile interface for users to decode, convert, and play these unique audio files without relying on graphical interfaces or specific game emulators. Its development is ongoing, with new formats and improvements continuously added by a community of contributors.

SEE ALSO

ffmpeg(1), sox(1), aplay(1), mplayer(1)

Copied to clipboard