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

Function computeAudioDt

src/fl/audio/audio_context.h:101–104  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

99/// Each buffer of pcmSize samples at sampleRate Hz represents exactly
100/// pcmSize/sampleRate seconds of audio, regardless of when the CPU reads it.
101inline float computeAudioDt(fl::size pcmSize, int sampleRate) FL_NOEXCEPT {
102 if (sampleRate <= 0 || pcmSize == 0) return 0.0f;
103 return static_cast<float>(pcmSize) / static_cast<float>(sampleRate);
104}
105
106} // namespace audio
107} // namespace fl

Callers 8

processSampleMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85
updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected