mirror of
https://github.com/ggerganov/wave-share.git
synced 2026-02-06 01:16:13 +08:00
The length of the data is encoded in the first 3 bytes of the transmission: - Byte 0: data length - Byte 1: ECC - Byte 2: ECC For this type of transmission it is necessary to add an "end-of-message" marker at the end of the Tx. This marker is used by the receiver to understand when the transmission is over. At this point the receiver starts analyzing the recorded data. First, the data length is decoded. After, this length is used to try to decode the remaining data. The number ECC bytes used for the payload is calculated as 2*(N/5), where N is the length of the payload.
13 lines
717 B
Bash
Executable File
13 lines
717 B
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "static const char * BUILD_TIMESTAMP=\"`date`\";" > build_timestamp.h
|
|
|
|
em++ -Wall -Wextra -O3 -std=c++11 -s USE_SDL=2 -s WASM=1 ./main.cpp -o wave.js -I ./fftw-3.3.3/api ./lib/libfftw3f.a \
|
|
-s EXPORTED_FUNCTIONS='["_getText", "_getSampleRate", "_setText", "_getAverageRxTime_ms", "_setParameters",
|
|
"_getFramesLeftToRecord", "_getFramesToRecord",
|
|
"_getFramesLeftToAnalyze", "_getFramesToAnalyze",
|
|
"_hasDeviceOutput", "_hasDeviceCapture", "_doInit",
|
|
"_setTxMode",
|
|
"_main"]' \
|
|
-s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap", "writeArrayToMemory"]'
|