Skip to main content

A python script for decoding Gameloft .vxn files.

Project description

vxn-py

A python script for extracting Gameloft .vxn files.

About vxn files

vxn files are a proprietary multistrean audio container that can be found in many Gameloft games. They can contain 1 of 4 different audio encodings, PCM, Microsoft ADPCM, Microsoft IMA ADPCM, or Musepack.

For a long time the only way to extract this audio data was by using vgmstream. This posed a problem due to how vgmstream works. The audio files you get back are PCM encoded (wav files), no matter what format the audio data was originally in. Not to mention, it uses ffmpeg to transcode the Musepack format into wav files. This is an issue because of audio integrity. If you wanted to get the raw audio data from vxn files with vgmstream, you won't be able to, which also means, you can't use whatever Musepack decoder you want.

That all changes with vxn-py. This program extracts the raw data from the vxn files without any modifications. The only additions are the wav file headers so that any program knows what wav file format it's dealing with. Any vxn files that has Musepack data in them, just contains the full mpc file, including its header, so thankfully I don't have to worry about that (figuring out the wav file header was already a pain). This means that no audio data could possibly be lost, because there is no audio transcoding being done. You can then do whatever you want with the data, including using other Musepack decoders (because some mpc files don't decode very well in ffmpeg).

Unfortunately, this program does not create vxn files, mainly because there's still other chunks that I don't know how to read yet.

Installation

Install with python

pip install vxn-py

Usage

python -m vxn extract "file.vxn"
python -m vxn extract -h
vxndec "file.vxn"
vxndec -h

Or within code.

from vxn import VXN

v = VXN('path/to/file.vxn')

v.streams[0].save(f'out.{v.streams[0].EXTENSION}')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vxn_py-1.0.3.tar.gz (45.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vxn_py-1.0.3-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file vxn_py-1.0.3.tar.gz.

File metadata

  • Download URL: vxn_py-1.0.3.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vxn_py-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3f238ec395b4a84c781f57c1fc576cda125f433ec3a0f23e11b43de29fbf1d5e
MD5 a73a8389c2573aa7bdf864a2d5caf3f0
BLAKE2b-256 947d5ec7d91e4fc77a4c3bc8391ffaf026e6690516a5c8b5dbbe3cdeeb296b99

See more details on using hashes here.

Provenance

The following attestation bundles were made for vxn_py-1.0.3.tar.gz:

Publisher: python-publish.yml on ego-lay-atman-bay/vxn-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vxn_py-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: vxn_py-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vxn_py-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 07d85ae25430ecd8aead1dd667068b7d31ed0d31611aada381a797c45852a92b
MD5 359bbe78f160a53ce4cbfc895a43780e
BLAKE2b-256 35f129afb314aef0c076799270c9ae37badf2829dbd9faad850401e29585b7bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for vxn_py-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on ego-lay-atman-bay/vxn-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page