FabGL
ESP32 Display Controller and Graphics Library
|
|
inline |
Plays the specified waveform.
Starts immediately to play the specified waveform. It is not required to call play(). This method returns without wait the end of sound.
waveform | Waveform to play. |
frequency | Frequency in Hertz. |
durationMS | Duration in milliseconds. |
volume | Volume value. Minimum is 0, maximum is 127. |
Example:
// plays a sinewave at 500Hz for 200 milliseconds soundGen.playSound(SineWaveformGenerator(), 500, 200); // plays a C Major chord for 1 second soundGen.playSound(SineWaveformGenerator(), 262, 1000); // C soundGen.playSound(SineWaveformGenerator(), 330, 1000); // E soundGen.playSound(SineWaveformGenerator(), 392, 1000); // G
Definition at line 431 of file soundgen.h.