Helper class to beep the pc speaker. More...
#include <senf/Utils/Beeper.hh>
Public Member Functions | |
Beeper (std::string const &device="/dev/console") | |
Construct a new Beeper for the given device. More... | |
~Beeper () | |
void | beep_sync (float freq, unsigned length, unsigned count=1, unsigned delay=100) |
play beep synchronous More... | |
void | beep_async (float freq, unsigned length, unsigned count=1, unsigned delay=100) |
play beep asynchronous More... | |
void | stop_beep () |
stop playing. More... | |
bool | start_beep (float freq) |
start playing. More... | |
Helper class to beep the pc speaker.
This helper class allows you to beep the pc speaker with precision like frequency and duration. The beep can be played synchronous and asynchronous.
Typically the /dev/console
device is used to control the local pc speaker. Note, that opening /dev/console
is a privileged operation on most systems.
KIOCSOUND
senf::Beeper::Beeper | ( | std::string const & | device = "/dev/console" | ) |
void senf::Beeper::beep_async | ( | float | freq, |
unsigned | length, | ||
unsigned | count = 1 , |
||
unsigned | delay = 100 |
||
) |
void senf::Beeper::beep_sync | ( | float | freq, |
unsigned | length, | ||
unsigned | count = 1 , |
||
unsigned | delay = 100 |
||
) |
bool senf::Beeper::start_beep | ( | float | freq | ) |
start playing.
start playing until any other member is called.
freq | frequency in Hz, where 0 < freq < 20000. |
void senf::Beeper::stop_beep | ( | ) |
stop playing.