Added RawPCM data that doesn't use ring buffer(for non-streaming), and proper deallocation

This commit is contained in:
2025-09-21 03:41:40 +03:00
parent 090317b394
commit 64a5d19464
3 changed files with 40 additions and 3 deletions

View File

@@ -24,7 +24,16 @@ Sound::Sound(Engine *engine, std::function<void(Sound *)> setupFunction,
}
Sound::~Sound() {
ma_pcm_rb_uninit(&maRingBuffer);
switch (type) {
case Sound::SoundType::RawPCM:
ma_audio_buffer_uninit_and_free(&maAudioBuffer);
break;
case Sound::SoundType::StreamedRawPCM:
ma_pcm_rb_uninit(&maRingBuffer);
break;
default:
break;
}
ma_sound_uninit(&maSound);
}