wemenc is a command-line tool written in Go for encoding audio files into the Wwise WEM format (Wwise Encoded Media). Currently, only the Opus codec is supported. It leverages ffmpeg for the underlying Opus encoding and packages the result into a Wwise-compatible RIFF container.
- Encodes any audio format supported by
ffmpegto WEM Opus. - Automatically handles Ogg/Opus stream parsing to extract raw packets.
- Generates required Wwise chunks:
fmt,seek(packet table), anddata. - Precise sample count handling using Ogg granule positions.
- Go: 1.25 or later.
- FFmpeg: Must be installed and available in your
PATH. The tool expectslibopussupport in FFmpeg.
Clone the repository and build the binary:
go build -o wemenc ./cmd/wemenc./wemenc -i <input_file> -o <output_file.wem> [-b <bitrate>]-i: Path to the input audio file (e.g.,.wav,.mp3).-o: Path to the output WEM file.-b: Bitrate for the Opus encoder (default:64k). You can use values like96k,128k, etc.
./wemenc -i music.wav -o music.wem -b 128k- FFmpeg Orchestration: The tool runs
ffmpegas a subprocess, pipe-encoding the input audio to an Ogg Opus stream. - Ogg Demuxing: A custom parser reads the Ogg stream from FFmpeg's stdout, extracting individual Opus packets and metadata like
pre-skipand channel count. - WEM Packaging: The extracted packets are wrapped into a RIFF/WAVE container with Wwise-specific headers and a packet size table (
seekchunk), making it compatible with games using the Audiokinetic Wwise engine and tools likevgmstream.
This project is licensed under the MIT License - see the LICENSE file for details.