Skip to content

A small toolbox for converting audio to CyberConnect2's formats

License

Notifications You must be signed in to change notification settings

mrsobakin/cc2_audio_encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CyberConnect2 audio encoding toolbox

A small toolbox for converting .wav audio files to CyberConnect2's formats (.bnsf, .hca, encoded .hca)

How to install

  1. If you're using linux, install wine
  2. Install ffmpeg
  3. cd into the repository folder
  4. pip install .

How to use

As a cli app

HCA

python -m cc2_audio_encoder hca <in_file.wav> <out_file.hca>

python -m cc2_audio_encoder hca -t <t> -k1 <k1> -k2 <k2> <in_file.wav> <out_file.hca>

  • t - encryption type
  • k1 - encryption key (1)
  • k2 - encryption key (2)

For JoJo ASBR, these arguments would be: -t 56 -k1 012C9A53 -k2 00000000

BNSF

python -m cc2_audio_encoder bnsf <in_file.wav> <out_file.bnsf>

To encode a stereo bnsf:

python -m cc2_audio_encoder bnsf --stereo <in_file.wav> <out_file.bnsf>

To include loop data into bnsf (use -h for further info):

python -m cc2_audio_encoder bnsf --loop <in_file.wav> <out_file.bnsf>

As a python module

from cc2_audio_encoder import bnsf, hca

bnsf_bytes = bnsf.encode("some_file.wav")
with open("audio.bnsf", "wb") as f:
    f.write(bnsf_bytes)

hca_bytes = hca.encode("some_file.wav", encryption={"t": 56, "k1": "012C9A53", "k2": "00000000"}):
with open("audio.hca", "wb") as f:
    f.write(hca_bytes)

Just explore the source code. It's very small.

Special thanks to:

  • vgmstream for reverse engineering the .bnsf header
  • This amazing article for reverse engineering the .bnsf header
  • NSUNS4 Toolbox for the compiled IS14 encoder (encode.exe), which I was too lazy to compile myself
  • Deretore for the HCA encoder and encrypter (hcaenc.exe, hcacc.exe)

About

A small toolbox for converting audio to CyberConnect2's formats

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages