mirror of
https://github.com/pstrueb/piper.git
synced 2026-04-16 13:25:30 +00:00
Fix for raw audio output on Windows
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user