MCPcopy Create free account
hub / github.com/FastLED/FastLED / getOrCreateContext

Function getOrCreateContext

tests/fl/audio/detector/vocal_real_audio.hpp:30–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30static fl::shared_ptr<audio::Context> getOrCreateContext(const audio::Sample& sample, int sampleRate) {
31 auto& ctx = sharedAudioContext();
32 if (!ctx) {
33 ctx = fl::make_shared<audio::Context>(sample);
34 ctx->setSampleRate(sampleRate);
35 } else {
36 ctx->setSample(sample);
37 ctx->setSampleRate(sampleRate);
38 }
39 return ctx;
40}
41
42// Scope guard that clears audio::Context history on test exit,
43// preventing state leakage between test cases while preserving

Callers 2

runDetectorOnPcmFunction · 0.85

Calls 2

setSampleMethod · 0.80
setSampleRateMethod · 0.45

Tested by

no test coverage detected