adding various improvements to the experience
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "boomcast_audio_calibration.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// BoomCast firmware configuration
|
||||
// Target: Waveshare ESP32-S3-ePaper-1.54 V2 (non-touch)
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#define BOOMCAST_FIRMWARE_VERSION "0.2.0-concept"
|
||||
#define BOOMCAST_FIRMWARE_VERSION "0.3.0-concept"
|
||||
|
||||
// Set to 180 when the board is physically mounted upside-down.
|
||||
// Supported by this sketch: 0 or 180.
|
||||
@@ -50,18 +51,27 @@ constexpr uint8_t AUDIO_MIC_SLOT = 0;
|
||||
constexpr uint32_t AUDIO_RAW_BLOCK_BYTES = 1024;
|
||||
constexpr uint32_t AUDIO_FRAMES_PER_BLOCK = AUDIO_RAW_BLOCK_BYTES / 4; // 16-bit stereo
|
||||
|
||||
constexpr uint32_t PRE_EVENT_MS = 2500;
|
||||
constexpr uint32_t POST_EVENT_MS = 2500;
|
||||
// Browser worklet reference: 10 s rolling clip, 2 s tail, 30 level windows/s.
|
||||
constexpr uint32_t DETECTION_WINDOWS_PER_SECOND = 30;
|
||||
constexpr float DETECTION_INITIAL_BASELINE = 0.01f;
|
||||
constexpr float DETECTION_BASELINE_ALPHA = 0.02f;
|
||||
constexpr float DETECTION_BASELINE_CLAMP = 2.0f;
|
||||
constexpr float DETECTION_RMS_FLOOR = 0.075f;
|
||||
constexpr float DETECTION_RMS_MULTIPLIER = 5.0f;
|
||||
constexpr float DETECTION_PEAK_FLOOR = 0.16f;
|
||||
constexpr uint32_t DETECTION_WARMUP_SAMPLES = AUDIO_SAMPLE_RATE;
|
||||
constexpr uint32_t DETECTION_COOLDOWN_SAMPLES = AUDIO_SAMPLE_RATE * 3;
|
||||
constexpr uint32_t PRE_EVENT_MS = 8000;
|
||||
constexpr uint32_t POST_EVENT_MS = 2000;
|
||||
constexpr uint32_t CAPTURE_MS = PRE_EVENT_MS + POST_EVENT_MS;
|
||||
constexpr size_t PRE_EVENT_SAMPLES = (AUDIO_SAMPLE_RATE * PRE_EVENT_MS) / 1000;
|
||||
constexpr size_t CAPTURE_SAMPLES = (AUDIO_SAMPLE_RATE * CAPTURE_MS) / 1000;
|
||||
|
||||
// Starting point inherited from the Atom Echo concept. The web slider modifies
|
||||
// software thresholds around these values rather than changing codec gain.
|
||||
// Hardware calibration, separate from the browser algorithm. The default
|
||||
// assumes codec PCM maps linearly to browser Float32 [-1,1]. Calibrate on V2.
|
||||
constexpr float AUDIO_MIC_NORMALISED_GAIN = BOOMCAST_DETECTION_INPUT_GAIN;
|
||||
constexpr float AUDIO_SENSITIVITY_REFERENCE = 55.0f;
|
||||
constexpr uint8_t DEFAULT_SENSITIVITY = 55; // 1..100
|
||||
constexpr uint32_t TRIGGER_COOLDOWN_MS = 1500;
|
||||
constexpr uint32_t AUDIO_WARMUP_MS = 3000;
|
||||
constexpr float NOISE_EMA_ALPHA = 0.008f;
|
||||
|
||||
// Display behaviour. Dynamic text uses the panel's partial-refresh waveform.
|
||||
// A periodic full refresh reduces accumulated ghosting.
|
||||
|
||||
Reference in New Issue
Block a user