ggwave-gui : wip file sharing support

This commit is contained in:
Georgi Gerganov
2020-12-30 12:04:38 +02:00
parent 442479bbaf
commit 82b0748830
12 changed files with 516 additions and 48 deletions

View File

@@ -1,10 +1,9 @@
#include "ggwave-common-sdl2.h"
#include "ggwave-common.h"
#include "ggwave/ggwave.h"
#include <SDL.h>
#include "ggwave-common.h"
#include <SDL_opengl.h>
#include <chrono>
@@ -15,6 +14,8 @@
#define EMSCRIPTEN_KEEPALIVE
#endif
constexpr double kBaseSampleRate = 48000.0;
namespace {
std::string g_defaultCaptureDeviceName = "";
@@ -30,7 +31,6 @@ GGWave *g_ggWave = nullptr;
}
// JS interface
extern "C" {
EMSCRIPTEN_KEEPALIVE
int sendData(int textLength, const char * text, int protocolId, int volume) {
@@ -117,7 +117,7 @@ bool GGWave_init(
SDL_AudioSpec playbackSpec;
SDL_zero(playbackSpec);
playbackSpec.freq = GGWave::kBaseSampleRate;
playbackSpec.freq = ::kBaseSampleRate;
playbackSpec.format = AUDIO_S16SYS;
playbackSpec.channels = 1;
playbackSpec.samples = 16*1024;
@@ -160,7 +160,7 @@ bool GGWave_init(
if (g_devIdIn == 0) {
SDL_AudioSpec captureSpec;
captureSpec = g_obtainedSpecOut;
captureSpec.freq = GGWave::kBaseSampleRate;
captureSpec.freq = ::kBaseSampleRate;
captureSpec.format = AUDIO_F32SYS;
captureSpec.samples = 4096;