mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-06 08:37:59 +08:00
* ggwave : add support for fixed length transmissions * spectrogram : add sample rate offset for debugging purposes * gwave : fix decoding bug * waver : wip * wip * remove post-marker frames * add resampler * ggwave : input/output resampling * ggwave : fix python build * ggwave : update spm * ggwave : refactor duplicate encode/decode code * ggwave : fix sound marker detection * waver : fix typo * ggwave : fix uninitialized members * ggwave : more sensitive receive
36 lines
730 B
C++
36 lines
730 B
C++
#include "ggwave/ggwave.h"
|
|
|
|
#include "ggwave-common.h"
|
|
#include "ggwave-common-sdl2.h"
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <cstdio>
|
|
#include <thread>
|
|
|
|
int main(int argc, char** argv) {
|
|
printf("Usage: %s [-cN]\n", argv[0]);
|
|
printf(" -cN - select capture device N\n");
|
|
printf("\n");
|
|
|
|
auto argm = parseCmdArguments(argc, argv);
|
|
int captureId = argm["c"].empty() ? 0 : std::stoi(argm["c"]);
|
|
|
|
if (GGWave_init(0, captureId) == false) {
|
|
fprintf(stderr, "Failed to initialize GGWave\n");
|
|
return -1;
|
|
}
|
|
|
|
while (true) {
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
GGWave_mainLoop();
|
|
}
|
|
|
|
GGWave_deinit();
|
|
|
|
SDL_CloseAudio();
|
|
SDL_Quit();
|
|
|
|
return 0;
|
|
}
|