| 15 | namespace { // Anonymous namespace for vibe tests |
| 16 | |
| 17 | void feedFrames(audio::detector::Vibe& detector, int count, float freq, |
| 18 | float amplitude = 16000.0f) { |
| 19 | for (int i = 0; i < count; ++i) { |
| 20 | auto sample = makeSample(freq, i * 12, amplitude); |
| 21 | auto ctx = fl::make_shared<audio::Context>(sample); |
| 22 | ctx->setSampleRate(44100); |
| 23 | detector.update(ctx); |
| 24 | detector.fireCallbacks(); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | void feedSilence(audio::detector::Vibe& detector, int count) { |
| 29 | for (int i = 0; i < count; ++i) { |
no test coverage detected