| 7 | namespace fl { |
| 8 | |
| 9 | class Null_Audio : public audio::IInput { |
| 10 | public: |
| 11 | ~Null_Audio() = default; |
| 12 | // Starts the audio source. |
| 13 | void start() override {} |
| 14 | // Stops the audio source, call this before light sleep. |
| 15 | void stop() override {} |
| 16 | |
| 17 | bool error(fl::string* msg = nullptr) FL_NOEXCEPT override { |
| 18 | if (msg) { |
| 19 | *msg = "No audio device available: this is a null device."; |
| 20 | } |
| 21 | return true; |
| 22 | } |
| 23 | // Read audio data and return as audio::Sample with calculated timestamp. |
| 24 | // Returns invalid audio::Sample on error or when no data is available. |
| 25 | audio::Sample read() FL_NOEXCEPT override { |
| 26 | return audio::Sample(); // Always return invalid sample |
| 27 | } |
| 28 | |
| 29 | }; |
| 30 | |
| 31 | } // namespace fl |