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

Method readAll

src/fl/audio/input.h:292–307  ·  view source on GitHub ↗

Read all available audio data and return as Sample. All AudioSamples returned by this will be valid. Gain is applied to each sample.

Source from the content-addressed store, hash-verified

290 // Read all available audio data and return as Sample. All AudioSamples
291 // returned by this will be valid. Gain is applied to each sample.
292 size_t readAll(fl::vector_inlined<Sample, 16> *out) FL_NOEXCEPT {
293 size_t count = 0;
294 while (true) {
295 Sample sample = read();
296 if (sample.isValid()) {
297 if (mGain != 1.0f) {
298 sample.applyGain(mGain);
299 }
300 out->push_back(sample);
301 count++;
302 } else {
303 break;
304 }
305 }
306 return count;
307 }
308
309 private:
310 float mGain = 1.0f;

Callers 1

createWithAutoInputMethod · 0.80

Calls 4

readFunction · 0.50
isValidMethod · 0.45
applyGainMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected