initial commit
This commit is contained in:
30
libraries/FastLED/src/platforms/audio_input_null.hpp
Normal file
30
libraries/FastLED/src/platforms/audio_input_null.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "fl/unused.h"
|
||||
#include "fl/audio_input.h"
|
||||
|
||||
namespace fl {
|
||||
|
||||
class Null_Audio : public IAudioInput {
|
||||
public:
|
||||
~Null_Audio() = default;
|
||||
// Starts the audio source.
|
||||
void start() override {}
|
||||
// Stops the audio source, call this before light sleep.
|
||||
void stop() override {}
|
||||
|
||||
bool error(fl::string* msg = nullptr) override {
|
||||
if (msg) {
|
||||
*msg = "No audio device available: this is a null device.";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// Read audio data and return as AudioSample with calculated timestamp.
|
||||
// Returns invalid AudioSample on error or when no data is available.
|
||||
AudioSample read() override {
|
||||
return AudioSample(); // Always return invalid sample
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // namespace fl
|
||||
Reference in New Issue
Block a user