mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
Replace process-spawning audio with miniaudio for non-blocking playback
Eliminates severe stuttering from fork/exec + disk I/O by streaming audio directly from memory using miniaudio library.
This commit is contained in:
parent
51e93808b3
commit
730017ce61
11 changed files with 96445 additions and 133 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include "platform/process.hpp"
|
||||
#include <cstdint>
|
||||
#include <random>
|
||||
#include <string>
|
||||
|
|
@ -49,8 +48,6 @@ private:
|
|||
};
|
||||
|
||||
void preloadSurface(FootstepSurface surface, const std::vector<std::string>& candidates);
|
||||
void stopCurrentProcess();
|
||||
void reapFinishedProcess();
|
||||
bool playRandomStep(FootstepSurface surface, bool sprinting);
|
||||
static const char* surfaceName(FootstepSurface surface);
|
||||
|
||||
|
|
@ -58,8 +55,6 @@ private:
|
|||
SurfaceSamples surfaces[7];
|
||||
size_t sampleCount = 0;
|
||||
|
||||
std::string tempFilePath = platform::getTempFilePath("wowee_footstep.wav");
|
||||
ProcessHandle playerPid = INVALID_PROCESS;
|
||||
std::chrono::steady_clock::time_point lastPlayTime = std::chrono::steady_clock::time_point{};
|
||||
|
||||
std::mt19937 rng;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue