audio export: confine Opus to 48000Hz

This commit is contained in:
tildearrow 2025-10-26 04:32:07 -05:00
parent a887b72d36
commit 529105d845
2 changed files with 13 additions and 25 deletions

View file

@ -629,7 +629,12 @@ bool DivEngine::saveAudio(const char* path, DivAudioExportOptions options) {
repeatPattern=false;
setOrder(0);
remainingLoops=-1;
got.rate=options.sampleRate;
if (options.format==DIV_EXPORT_FORMAT_OPUS) {
// Opus only supports 48KHz and a couple divisors of that number...
got.rate=48000;
} else {
got.rate=options.sampleRate;
}
if (shallSwitchCores()) {
bool isMutedBefore[DIV_MAX_CHANS];