Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] 432Hz Batch Converter - Option to instead alter playback sample rate and directly copy source audio stream #37

Open
NintendoManiac64 opened this issue Feb 10, 2024 · 0 comments

Comments

@NintendoManiac64
Copy link

NintendoManiac64 commented Feb 10, 2024

As mentioned in issue #36, there are times when you're not able to use a transcoded version of your source audio and therefore are forced to instead directly alter the playback sample rate.

It would be great if 432Hz Batch Converter had the functionality to directly write that sample rate value (rounding to the nearest integer of course) to what is nothing more than a copy of the source audio stream, making it a lossless operation without transcoding (and obviously this would by definition be locked to only be able to do "skip tempo adjustment for quality" since anything else isn't possible without transcoding).

 
Now this obviously won't work for the mentioned proprietary ADPCM formats, but it can work for more standard formats, particularly WAV and OGG vorbis (the latter of which is used a lot in games and visual novels).

To clarify, there's an old WinXP-era program called "Header Investigator" (it even works in wine) that can do this for WAV files, but it's limited to specific values unless you hex-edit the program EXE (which I did previously to add support for 32bit as well as 176400Hz):

 
However, I don't believe there's any software that does this for OGG vorbis files let alone any other possible formats like at least M4A/AAC and FLAC (MP3 and Opus only support a specific set of sample rates).

It's important to note that, at least for OGG vorbis, changing the hex sample rate value results in a CRC error that not all software will handle (foobar2000, MPC-HC, and VLC can't read said OGG vorbis files, but Audacity, Audacious, and Celluloid/mpv can read them without issue).
I did discover however that if you first package your source unmodified OGG vorbis into an mkv, hex-edit the sample rate value, and then re-extract the vorbis stream back into an OGG container, it'll avoid the CRC error issue (though some vorbis streams end up being only like 99.999% lossless when doing this for some reason, having a couple single-sample -50dB deviations oddly enough).

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

No branches or pull requests

1 participant