Audio system cleanup and comments

This commit is contained in:
PJB3005
2026-03-20 17:51:42 +01:00
parent c940e04b56
commit 6443b9fded
4 changed files with 152 additions and 69 deletions
+17 -5
View File
@@ -16,7 +16,7 @@
#include "DuskDsp.hpp"
#include "JSystem/JAudio2/JASAudioThread.h"
#define DUSK_DUMP_AUDIO
// #define DUSK_DUMP_AUDIO
using namespace dusk::audio;
@@ -25,13 +25,25 @@ static std::array<f32, DSP_SUBFRAME_SIZE * OutputSubframe::NUM_CHANNELS> OutInte
static SDL_AudioStream* PlaybackStream;
/**
* SDL audiostream callback to trigger rendering of new audio data.
*/
static void SDLCALL GetNewAudio(
void *userdata,
SDL_AudioStream *stream,
int additional_amount,
int total_amount);
void*,
SDL_AudioStream*,
int needed,
int);
/**
* Render an entire new frame of audio and output it to SDL3.
* Note: "audio frames" are unrelated to video frames.
* @return Amount of audio samples rendered.
*/
static int RenderNewAudioFrame();
/**
* Render an audio subframe and output it to SDL3.
*/
static void RenderAudioSubframe();
static void InitSDL3Output() {