22 #ifndef AUDIO_SOFTSYNTH_PCSPK_H 23 #define AUDIO_SOFTSYNTH_PCSPK_H 25 #include "audio/audiostream.h" 26 #include "common/mutex.h" 27 #include "common/queue.h" 48 Command(WaveForm waveForm,
float frequency, uint32 length);
59 void play(WaveForm wave,
int freq, int32 length);
80 void playQueue(WaveForm wave,
float freq, uint32 lengthus);
82 void stop(int32 delay = 0);
86 bool isPlaying()
const;
88 int readBuffer(int16 *buffer,
const int numSamples);
103 uint32 _remainingSamples;
104 uint32 _mixedSamples;
114 typedef int8 (*generatorFunc)(uint32, uint32);
115 static const generatorFunc generateWave[];
117 static int8 generateSquare(uint32 x, uint32 oscLength);
118 static int8 generateSine(uint32 x, uint32 oscLength);
119 static int8 generateSaw(uint32 x, uint32 oscLength);
120 static int8 generateTriangle(uint32 x, uint32 oscLength);
121 static int8 generateSilence(uint32 x, uint32 oscLength);
126 #endif // AUDIO_SOFTSYNTH_PCSPEAKER_H void setVolume(byte volume)
void playQueue(WaveForm wave, float freq, uint32 lengthus)
bool endOfData() const
Definition: pcspk.h:91
void play(WaveForm wave, int freq, int32 length)
bool endOfStream() const
Definition: pcspk.h:92
Definition: audiostream.h:50
bool isStereo() const
Definition: pcspk.h:90
int getRate() const
Definition: pcspk.h:93
int readBuffer(int16 *buffer, const int numSamples)