Change the sound buffer size to a power of 2
Turns out giving SDL2 a non-power-of-2 buffer size crashes it in Emscripten.
This commit is contained in:
parent
d2b5872c95
commit
0fb147aa0d
1 changed files with 2 additions and 2 deletions
|
@ -16,9 +16,9 @@
|
|||
#define FREQUENCY 44100
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#define STREAM_SIZE 0x400
|
||||
#define STREAM_SIZE 0x400 // Larger buffer to prevent stutter
|
||||
#else
|
||||
#define STREAM_SIZE (FREQUENCY / 200)
|
||||
#define STREAM_SIZE 0x100 // FREQUENCY/200 rounded to the nearest power of 2 (SDL2 *needs* a power-of-2 buffer size)
|
||||
#endif
|
||||
|
||||
#define clamp(x, y, z) (((x) > (z)) ? (z) : ((x) < (y)) ? (y) : (x))
|
||||
|
|
Loading…
Add table
Reference in a new issue