Fix for raw audio output on Windows

pull/266/head
Michael Hansen 7 months ago
parent 1d3e8b2901
commit 91b8d422c1

@ -18,6 +18,11 @@
#include <windows.h>
#endif
#ifdef _WIN32
#include <io.h>
#include <fcntl.h>
#endif
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
@ -307,6 +312,12 @@ int main(int argc, char *argv[]) {
vector<int16_t> audioBuffer;
vector<int16_t> sharedAudioBuffer;
#ifdef _WIN32
// Needed on Windows to avoid terminal conversions
setmode(fileno(stdout),O_BINARY);
setmode(fileno(stdin),O_BINARY);
#endif
thread rawOutputThread(rawOutputProc, ref(sharedAudioBuffer),
ref(mutAudio), ref(cvAudio), ref(audioReady),
ref(audioFinished));

Loading…
Cancel
Save