Page 1 of 1

(Doubt) Possibility of HCA or ADX audio support (CRI Middleware)

Posted: Fri Jul 02, 2021 4:35 am
by CharlieFuu69
Hello everybody.

In this instance I want to ask you for help with a question rather than a problem, although I would appreciate that someone more experienced in Ren'Py / Python can give me some indication.

A few months ago I acquired the equipment from CRI Middleware (CRIWARE), with tools that are used to encode audio and video, although at the moment I am interested in encoding audio. My idea behind this was to convert my current audio files into HCA or ADX format (both codecs provided by CRIWARE), and the reason behind this is that the audio formats that Ren'Py allows are very accessible by anyone person who can unpack the RPA files. At least I want to make accessing the audio files a bit more difficult. The point, it is obvious that Ren'Py does not support HCA or ADX audios.

Given this, I decided to investigate and then I found that Ren'Py uses the "ffmpeg" library to deal with audio files, and that gave me a little light of hope since according to the library's website, / encoding is supported CRIWARE HCA and ADX audio decoding.

Source: https://www.ffmpeg.org/general.html#Audio-Codecs

The point is this. What part of Ren'Py handles audio files? Or, if possible, how can I make Ren'Py able to read and play HCA audio?
I've seen on GitHub that there are HCA to WAV converters with code written in Python, but I think I need a more accurate hint to be able to implement what I want in my game.

Any answer will be very helpful to me to achieve what I want.

Thanks for reading: 3

Re: (Doubt) Possibility of HCA or ADX audio support (CRI Middleware)

Posted: Fri Jul 02, 2021 4:38 pm
by PyTom
I don't have any plans to make builds of Ren'Py that support other audio formats.

Re: (Doubt) Possibility of HCA or ADX audio support (CRI Middleware)

Posted: Sat Jul 03, 2021 1:38 am
by CharlieFuu69
There is no problem that the developer of the engine decides not to include support for more audio codecs, rather, the idea was to try to set up its own system to handle the HCA / ADX audios, so that it could be defined as:

Code: Select all

define audio.song_01 = AudioData("bytes", "fn")
And be able to reproduce them as:

Code: Select all

play music song_01
In the hypothetical case that you managed to get the audio bytes from an HCA / ADX file, could you use AudioData () to record those bytes as a playable music track?

Re: (Doubt) Possibility of HCA or ADX audio support (CRI Middleware)

Posted: Sat Jul 03, 2021 2:04 am
by PyTom
Not directly. You could probably slap RIFF headers on the front, and make it into a signed 16-bit wav file, and pass that to AudioData.

Re: (Doubt) Possibility of HCA or ADX audio support (CRI Middleware)

Posted: Sat Jul 03, 2021 6:09 am
by CharlieFuu69
Those few words are serving me too much. These were the clues he needed to achieve what he wanted. Thanks PyTom!
When I get good results, I am going to put a little tutorial in this post. It will serve more than one of them to "obfuscate" the assets of their games a bit.