diff --git a/.gitignore b/.gitignore
index 7a72417..30bcdfd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
build
build-*
compile_commands.json
+.exrc
.clangd
.cache
.vimspector.json
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 113df7f..c2e2efa 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -79,9 +79,6 @@ if (GGWAVE_SUPPORT_SDL2)
)
endif()
-# modified ggwave used by some of the examples
-add_subdirectory(ggwave-mod/src)
-
# examples
if (EMSCRIPTEN)
diff --git a/examples/arduino-rx-web/CMakeLists.txt b/examples/arduino-rx-web/CMakeLists.txt
index 3aa06b7..0b39aea 100644
--- a/examples/arduino-rx-web/CMakeLists.txt
+++ b/examples/arduino-rx-web/CMakeLists.txt
@@ -15,10 +15,10 @@ if (NOT EMSCRIPTEN)
target_link_libraries(${TARGET} PRIVATE
ggwave-common
- ggwave-mod
+ ggwave
${SDL2_LIBRARIES}
)
else()
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index-tmpl.html ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/index.html @ONLY)
- configure_file(${CMAKE_SOURCE_DIR}/examples/ggwave-mod/src/ggwave-mod.js ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/ggwave-mod.js COPYONLY)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index-tmpl.html ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/index.html @ONLY)
+ configure_file(${CMAKE_SOURCE_DIR}/bindings/javascript/ggwave.js ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}/ggwave.js COPYONLY)
endif()
diff --git a/examples/arduino-rx-web/arduino-rx-web.cpp b/examples/arduino-rx-web/arduino-rx-web.cpp
index 83e909a..5672c7a 100644
--- a/examples/arduino-rx-web/arduino-rx-web.cpp
+++ b/examples/arduino-rx-web/arduino-rx-web.cpp
@@ -138,7 +138,7 @@ bool GGWave_init(
SDL_AudioSpec playbackSpec;
SDL_zero(playbackSpec);
- playbackSpec.freq = GGWave::kBaseSampleRate + sampleRateOffset;
+ playbackSpec.freq = GGWave::kDefaultSampleRate + sampleRateOffset;
playbackSpec.format = AUDIO_S16SYS;
playbackSpec.channels = 1;
playbackSpec.samples = 16*1024;
@@ -181,7 +181,7 @@ bool GGWave_init(
if (g_devIdInp == 0) {
SDL_AudioSpec captureSpec;
captureSpec = g_obtainedSpecOut;
- captureSpec.freq = GGWave::kBaseSampleRate + sampleRateOffset;
+ captureSpec.freq = GGWave::kDefaultSampleRate + sampleRateOffset;
captureSpec.format = AUDIO_F32SYS;
captureSpec.samples = 1024;
@@ -238,10 +238,13 @@ bool GGWave_init(
payloadLength,
(float) g_obtainedSpecInp.freq,
(float) g_obtainedSpecOut.freq,
+ GGWave::kDefaultSampleRate,
512,
GGWave::kDefaultSoundMarkerThreshold,
sampleFormatInp,
- sampleFormatOut});
+ sampleFormatOut,
+ GGWAVE_OPERATING_MODE_RX_AND_TX,
+ });
}
return true;
@@ -340,12 +343,12 @@ int main(int argc, char** argv) {
#endif
const GGWave::TxProtocols protocols = {
- { GGWAVE_TX_PROTOCOL_CUSTOM_0, { "[R2T2] Normal", 64, 9, 1, } },
- { GGWAVE_TX_PROTOCOL_CUSTOM_1, { "[R2T2] Fast", 64, 6, 1, } },
- { GGWAVE_TX_PROTOCOL_CUSTOM_2, { "[R2T2] Fastest", 64, 3, 1, } },
- { GGWAVE_TX_PROTOCOL_CUSTOM_3, { "[R2T2] Low Normal", 16, 9, 1, } },
- { GGWAVE_TX_PROTOCOL_CUSTOM_4, { "[R2T2] Low Fast", 16, 6, 1, } },
- { GGWAVE_TX_PROTOCOL_CUSTOM_5, { "[R2T2] Low Fastest", 16, 3, 1, } },
+ { GGWAVE_TX_PROTOCOL_CUSTOM_0, { "[R2T2] Normal", 64, 9, 1, 2, } },
+ { GGWAVE_TX_PROTOCOL_CUSTOM_1, { "[R2T2] Fast", 64, 6, 1, 2, } },
+ { GGWAVE_TX_PROTOCOL_CUSTOM_2, { "[R2T2] Fastest", 64, 3, 1, 2, } },
+ { GGWAVE_TX_PROTOCOL_CUSTOM_3, { "[R2T2] Low Normal", 16, 9, 1, 2, } },
+ { GGWAVE_TX_PROTOCOL_CUSTOM_4, { "[R2T2] Low Fast", 16, 6, 1, 2, } },
+ { GGWAVE_TX_PROTOCOL_CUSTOM_5, { "[R2T2] Low Fastest", 16, 3, 1, 2, } },
};
const auto argm = parseCmdArguments(argc, argv);
diff --git a/examples/arduino-rx-web/index-tmpl.html b/examples/arduino-rx-web/index-tmpl.html
index a426014..66ac4d1 100644
--- a/examples/arduino-rx-web/index-tmpl.html
+++ b/examples/arduino-rx-web/index-tmpl.html
@@ -58,7 +58,7 @@
-
+