A small toolbox for converting .wav audio files to CyberConnect2's formats (.bnsf, .hca, encoded .hca)
- If you're using linux, install
wine - Install
ffmpeg cdinto the repository folderpip install .
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
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>
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.
- vgmstream for reverse engineering the
.bnsfheader - This amazing article for reverse engineering the
.bnsfheader - 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)