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

Function makeSample

tests/fl/audio/test_helpers.hpp:51–58  ·  view source on GitHub ↗

Generate a sine wave and create an audio::Sample in one step

Source from the content-addressed store, hash-verified

49
50/// Generate a sine wave and create an audio::Sample in one step
51inline audio::Sample makeSample(float frequency, u32 timestamp,
52 float amplitude = 16000.0f,
53 size count = 512,
54 float sampleRate = 44100.0f) {
55 vector<i16> data = generateSineWave(count, frequency, sampleRate,
56 static_cast<i16>(amplitude));
57 return createSample(data, timestamp);
58}
59
60/// Generate a constant amplitude signal (for level testing)
61inline audio::Sample makeSample(i16 amplitude, u32 timestamp, size count = 512) {

Callers 1

makeSilenceFunction · 0.70

Calls 2

generateSineWaveFunction · 0.85
createSampleFunction · 0.85

Tested by

no test coverage detected