ggwave : add default samples per frame

This commit is contained in:
Georgi Gerganov
2021-01-16 18:39:11 +02:00
parent 9fe9a0240e
commit 94978e679a
3 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
#include <chrono>
#include <algorithm>
#include <random>
#include <stdexcept>
namespace {
@@ -163,6 +164,10 @@ GGWave::GGWave(
m_outputBlock(kMaxSamplesPerFrame),
m_outputBlock16(kMaxRecordedFrames*kMaxSamplesPerFrame)
{
if (samplesPerFrame > kMaxSamplesPerFrame) {
throw std::runtime_error("Invalid samples per frame");
}
init(0, "", getDefultTxProtocol(), 0);
}