Skip to content

Support building USM with different HCA audio sample rates#16

Closed
Mikewando wants to merge 105 commits into
Youjose:mainfrom
Mikewando:mixed-audio-rate
Closed

Support building USM with different HCA audio sample rates#16
Mikewando wants to merge 105 commits into
Youjose:mainfrom
Mikewando:mixed-audio-rate

Conversation

@Mikewando

Copy link
Copy Markdown

USMs can have multiple HCA tracks each with different sample rates (for example the lunar silver star remastered opening cutscene has japanese audio at 22.05KHz and english audio at 48KHz). These changes add support for building USMs that will play with these conditions.

Youjose and others added 27 commits March 29, 2023 15:56
In Python 3.11 IntFlag acts weirdly and so I reverted it back to an Enum.
A bug occurs sometimes for when not accounting for UTF padding bytes in the TOC size estimation.
Possibly might break other CPK's, but not sure for now.
Overhauled the ADX decoder and encoder to entirely be in C++.
Added a lot of features to the ADX decoder and encoder, it now supports any bit depths and blocksizes within the limits.
Removed one feature, which is controlling the DataOffset when encoding an ADX, as it's usually not needed.
Minor AWB fix, could be a breaking change for certain cases, unclear at the moment, tested it on the AWB samples that I have and it seems to be working.
Fixed the ADX API usage in the USM file, however it is not tested, it should work as long as the input is valid. Which is now limited to wav and not pure ADX as it used to be, this will be fixed in a planned overhaul.
PCM module used to segfaults after 0.4.4 because the added destructor missed a case when the buffer is loaded directly instead from a file or converted.
Added set HCA quality parameter, not advised to use, since from `Low` and below the audio may break up.
HCA encoding had an error on two occasions, one was with last trailing frames where the bit writer might segfault.
And the other was in calculating initial values where I wrongly ported the code from VGAudio.
As well as `-O3`, but setuptools already adds "-O" in gcc/clang (and /O2 in cl/msvc), so I am not sure which overrides which.
The offsets were swapped on the loop write function, fixed the order, also fixed the values written on these offsets to be the proper ones (tested lazily).
USMs can have multiple HCA tracks each with different sample rates (for
example the lunar silver star remastered opening cutscene has japanese
audio at 22.05KHz and english audio at 48KHz). These changes add support
for building USMs that will play with these conditions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants