1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:07:34 +00:00

Kernel+Userland: Add support for using the PCSpeaker with various tones

This commit is contained in:
Liav A 2023-03-01 22:05:04 +02:00 committed by Sam Atkins
parent 2d27c98659
commit 11a7e21c2a
9 changed files with 26 additions and 12 deletions

View file

@ -132,9 +132,9 @@ namespace Core::System {
#ifdef AK_OS_SERENITY
ErrorOr<void> beep()
ErrorOr<void> beep(Optional<size_t> tone)
{
auto rc = ::sysbeep();
auto rc = ::sysbeep(tone.value_or(440));
if (rc < 0)
return Error::from_syscall("beep"sv, -errno);
return {};