POORLY WORKING Opus export

This commit is contained in:
tildearrow 2025-10-22 20:57:38 -05:00
parent e485c05a80
commit 1bf5e8baaa
5 changed files with 243 additions and 20 deletions

View file

@ -103,27 +103,43 @@ enum DivMIDIModes {
enum DivAudioExportFormats {
DIV_EXPORT_FORMAT_S16=0,
DIV_EXPORT_FORMAT_F32
DIV_EXPORT_FORMAT_F32,
DIV_EXPORT_FORMAT_OPUS,
DIV_EXPORT_FORMAT_FLAC,
DIV_EXPORT_FORMAT_VORBIS,
DIV_EXPORT_FORMAT_MPEG_L3
};
enum DivAudioExportBitrateModes {
DIV_EXPORT_BITRATE_CONSTANT=0,
DIV_EXPORT_BITRATE_VARIABLE,
DIV_EXPORT_BITRATE_AVERAGE,
};
struct DivAudioExportOptions {
DivAudioExportModes mode;
DivAudioExportFormats format;
DivAudioExportBitrateModes bitRateMode;
int sampleRate;
int chans;
int loops;
double fadeOut;
int orderBegin, orderEnd;
bool channelMask[DIV_MAX_CHANS];
int bitRate;
float vbrQuality;
DivAudioExportOptions():
mode(DIV_EXPORT_MODE_ONE),
format(DIV_EXPORT_FORMAT_S16),
bitRateMode(DIV_EXPORT_BITRATE_CONSTANT),
sampleRate(44100),
chans(2),
loops(0),
fadeOut(0.0),
orderBegin(-1),
orderEnd(-1) {
orderEnd(-1),
bitRate(128000),
vbrQuality(6.0f) {
for (int i=0; i<DIV_MAX_CHANS; i++) {
channelMask[i]=true;
}
@ -498,9 +514,12 @@ class DivEngine {
DivAudioEngines audioEngine;
DivAudioExportModes exportMode;
DivAudioExportFormats exportFormat;
DivAudioExportBitrateModes exportBitRateMode;
double exportFadeOut;
bool isFadingOut;
int exportOutputs;
int exportBitRate;
float exportVBRQuality;
bool exportChannelMask[DIV_MAX_CHANS];
DivConfig conf;
FixedQueue<DivNoteEvent,8192> pendingNotes;
@ -1488,9 +1507,12 @@ class DivEngine {
audioEngine(DIV_AUDIO_NULL),
exportMode(DIV_EXPORT_MODE_ONE),
exportFormat(DIV_EXPORT_FORMAT_S16),
exportBitRateMode(DIV_EXPORT_BITRATE_CONSTANT),
exportFadeOut(0.0),
isFadingOut(false),
exportOutputs(2),
exportBitRate(128000),
exportVBRQuality(6.0f),
cmdStreamInt(NULL),
midiBaseChan(0),
midiPoly(true),