FastLED 3.9.15
Loading...
Searching...
No Matches

◆ setSampleRate()

void fl::audio::Processor::setSampleRate ( int sampleRate)

Set the sample rate for all frequency-based calculations.

This propagates to Context and all detector. Default is 44100 Hz. Common values: 16000, 22050, 44100.

Definition at line 722 of file audio_processor.cpp.hpp.

722 {
723 mSampleRate = sampleRate;
724 mContext->setSampleRate(sampleRate);
725
726 // Propagate to all active detector that are sample-rate-aware
727 for (auto& d : mActiveDetectors) {
728 d->setSampleRate(sampleRate);
729 }
730}
shared_ptr< Context > mContext
vector< shared_ptr< Detector > > mActiveDetectors

References mActiveDetectors, mContext, mSampleRate, and setSampleRate().

Referenced by onDropImpact(), and setSampleRate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: