Code Monkey home page Code Monkey logo

riffext's Introduction

RiffExt

This is a program to extract RIFF data from arbitrary files.

Although originally made to rip audio from Baldur's Gate 3, this should work for any file that doesn't do anything too weird to the RIFF headers.

Output files have the .wem extension.

The program identifies RIFF files by the strings RIFF, WAVE and fmt in the header.

RiffScan

This utility scans files and displays info on any RIFF files inside. It's useful to scope out a data file before you start extracting anything. RiffScan outputs in CSV text (separated by commas). You can pipe the output directly to a file.

riffscan.exe soundbank.dat > out.csv

Usage

Windows

You can compile the source yourself, or download executables for RiffExt and RiffScan from the Releases section.

In a Command Prompt, type:

riffext.exe <filename>
riffscan.exe <filename>

macOS/Linux

Compile the source code using your favourite C compiler.

Then type in bash:

./riffext <filename>
./riffscan <filename>


RiffExt args

You can use -m to set a minimum filesize (in bytes) for extraction, or -i to extract a file at a certain index (starting from 1).

riffext.exe soundbank.dat -m 500000
riffext.exe soundbank.dat -i 900

RiffScan args

RiffScan normally does a few more checks that RiffExt doesn't, in order to get the information needed to calculate things like file size and play length. This may result in some files not scanning or scanning incorrectly, if they don't conform to the RIFF standard properly.

When this is the case, you can use the arguments -s0 or -s1 to ignore these checks.

The argument -s0 performs no checks in addition to what RiffExt does, so it shows you exactly what you will get when you run RiffExt. However, it will not output any information other than filesize.

The argument -s1 performs only some checks in addition to what RiffExt does, but may output incorrect information on some more complex RIFF files. For this reason, avoid using -s1 unless the scan fails without it.

riffscan.exe soundbank.dat -s0
riffscan.exe soundbank.dat -s1

Extracting Video Game Sound Files

The vgmstream CLI tool is very helpful in converting extracted .wem files to playable .wav ones.

If your .wem files have format 0xFFFF, you can also use ww2ogg (optionally with the ReVorb tool) to convert them into .ogg format.

These tools will work for a lot of games. Some games I've tested are:

  • Cyberpunk 2077
  • Assassin's Creed Valhalla
  • Tom Clancy's The Division 2 (you may need to use -s1 with RiffScan for some files)
  • Divinity: Original Sin 2
  • Baldur's Gate 3
  • The Elder Scrolls Online (do not use -s1 with RiffScan)

riffext's People

Contributors

pkbeam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.