Skip to content

Commit d6b24a2

Browse files
committed
MiniAudioStream: setupBuffers() in begin
1 parent e61826f commit d6b24a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/AudioTools/AudioLibs/MiniAudioStream.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "miniaudio.h"
1414

1515
#define MA_BUFFER_COUNT 100
16+
#define MA_BUFFER_SIZE 1200
1617
#define MA_START_COUNT MA_BUFFER_COUNT - 2
1718
#define MA_DELAY 10
1819

@@ -108,6 +109,7 @@ class MiniAudioStream : public AudioStream {
108109

109110
bool begin() override {
110111
TRACEI();
112+
setupBuffers();
111113
if (config.is_output && !config.is_input)
112114
config_ma = ma_device_config_init(ma_device_type_playback);
113115
else if (!config.is_output && config.is_input)
@@ -310,7 +312,7 @@ class MiniAudioStream : public AudioStream {
310312
// you can move data from pInput into pOutput. Never process more than
311313
// frameCount frames.
312314

313-
void setupBuffers(int size) {
315+
void setupBuffers(int size = MA_BUFFER_SIZE) {
314316
std::lock_guard<std::mutex> guard(write_mtx);
315317
if (is_buffers_setup.load()) return;
316318

0 commit comments

Comments
 (0)