ggwave : add "soundMarkerThreshold" parameter

Can be used to control the threshold used for distinguishing odd from even
frequencies in the sound markers.
This commit is contained in:
Georgi Gerganov
2021-02-21 00:13:28 +02:00
parent 6011c0cef2
commit f4fb02d5d4
5 changed files with 14 additions and 5 deletions

View File

@@ -69,6 +69,7 @@ extern "C" {
int sampleRateInp; // capture sample rate
int sampleRateOut; // playback sample rate
int samplesPerFrame; // number of samples per audio frame
float soundMarkerThreshold; // sound marker detection threshold
ggwave_SampleFormat sampleFormatInp; // format of the captured audio samples
ggwave_SampleFormat sampleFormatOut; // format of the playback audio samples
} ggwave_Parameters;
@@ -225,6 +226,7 @@ public:
static constexpr auto kBaseSampleRate = 48000;
static constexpr auto kDefaultSamplesPerFrame = 1024;
static constexpr auto kDefaultVolume = 10;
static constexpr auto kDefaultSoundMarkerThreshold = 3.0f;
static constexpr auto kMaxSamplesPerFrame = 2048;
static constexpr auto kMaxDataBits = 256;
static constexpr auto kMaxDataSize = 256;
@@ -378,6 +380,8 @@ private:
const int m_nMarkerFrames;
const int m_encodedDataOffset;
const float m_soundMarkerThreshold;
// common
bool m_isFixedPayloadLength;