Skip to content

Instantly share code, notes, and snippets.

@sehraf
Created December 4, 2020 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehraf/75aa1cfe2609367f71418bf2eacf7da7 to your computer and use it in GitHub Desktop.
Save sehraf/75aa1cfe2609367f71418bf2eacf7da7 to your computer and use it in GitHub Desktop.
#pragma once
#include <AudioOutput.h>
class AudioOutputFixedRates : public AudioOutput
{
public:
AudioOutputFixedRates(AudioOutput *dest);
virtual ~AudioOutputFixedRates() override;
virtual bool SetRate(int hz) override { return true; }
virtual bool SetBitsPerSample(int bits) override { return true; }
virtual bool SetChannels(int channels) override { return true; }
virtual bool begin() override;
virtual bool ConsumeSample(int16_t sample[2]) override;
virtual bool stop() override;
bool SetFixedRate(int hz);
bool SetFixedBitsPerSample(int bits);
bool SetFixedChannels(int channels);
protected:
AudioOutput *sink;
};%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment