wip : refactor GGWave

This commit is contained in:
Georgi Gerganov
2020-12-05 13:20:06 +02:00
parent a02ead3b90
commit 4a8a219f39
3 changed files with 320 additions and 338 deletions

View File

@@ -48,9 +48,6 @@ extern "C" {
EMSCRIPTEN_KEEPALIVE
int getSampleRate() { return g_ggWave->getSampleRateIn(); }
EMSCRIPTEN_KEEPALIVE
float getAverageRxTime_ms() { return g_ggWave->getAverageRxTime_ms(); }
EMSCRIPTEN_KEEPALIVE
int getFramesToRecord() { return g_ggWave->getFramesToRecord(); }
@@ -67,7 +64,7 @@ extern "C" {
int hasDeviceOutput() { return g_devIdOut; }
EMSCRIPTEN_KEEPALIVE
int hasDeviceCapture() { return (g_ggWave->getTotalBytesCaptured() > 0) ? g_devIdIn : 0; }
int hasDeviceCapture() { return g_devIdIn; }
EMSCRIPTEN_KEEPALIVE
int doInit() {
@@ -239,7 +236,7 @@ bool GGWave_mainLoop() {
return SDL_DequeueAudio(g_devIdIn, data, nMaxBytes);
};
if (g_ggWave->getHasData() == false) {
if (g_ggWave->hasTxData() == false) {
SDL_PauseAudioDevice(g_devIdOut, SDL_FALSE);
static auto tLastNoData = std::chrono::high_resolution_clock::now();