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

◆ computeAudioDt()

float fl::audio::computeAudioDt ( fl::size pcmSize,
int sampleRate )
inline

Compute the time delta (in seconds) for an audio buffer.

Each buffer of pcmSize samples at sampleRate Hz represents exactly pcmSize/sampleRate seconds of audio, regardless of when the CPU reads it.

Definition at line 101 of file audio_context.h.

101 {
102 if (sampleRate <= 0 || pcmSize == 0) return 0.0f;
103 return static_cast<float>(pcmSize) / static_cast<float>(sampleRate);
104}

References FL_NOEXCEPT.

Referenced by fl::audio::Reactive::processSample(), fl::audio::detector::EnergyAnalyzer::update(), fl::audio::detector::EqualizerDetector::update(), fl::audio::detector::FrequencyBands::update(), fl::audio::detector::Percussion::update(), fl::audio::detector::Pitch::update(), fl::audio::detector::Vibe::update(), and fl::audio::detector::Vocal::update().

+ Here is the caller graph for this function: