mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 21:39:01 -04:00
Implement master volume & volume interpolation
Does not fix clicking :( Fixes https://github.com/TakaRikka/dusk/issues/132 Fixes https://github.com/TakaRikka/dusk/issues/128
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "DuskDsp.hpp"
|
||||
#include "JSystem/JAudio2/JASAudioThread.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
|
||||
// #define DUSK_DUMP_AUDIO
|
||||
|
||||
@@ -73,6 +74,12 @@ void dusk::audio::Initialize() {
|
||||
SDL_ResumeAudioStreamDevice(PlaybackStream);
|
||||
}
|
||||
|
||||
void dusk::audio::SetMasterVolume(const f32 value) {
|
||||
JASCriticalSection section;
|
||||
|
||||
MasterVolume = value;
|
||||
}
|
||||
|
||||
void SDLCALL GetNewAudio(
|
||||
void*,
|
||||
SDL_AudioStream*,
|
||||
@@ -132,3 +139,11 @@ void RenderAudioSubframe() {
|
||||
|
||||
SDL_PutAudioStreamData(PlaybackStream, &OutInterleaveBuffer, sizeof(OutInterleaveBuffer));
|
||||
}
|
||||
|
||||
u32 dusk::audio::GetResetCount(int channelIdx) {
|
||||
return ChannelAux[channelIdx].resetCount;
|
||||
}
|
||||
|
||||
f32 dusk::audio::VolumeFromU16(u16 value) {
|
||||
return static_cast<f32>(value) / static_cast<f32>(JASDriver::getChannelLevel_dsp());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user