Page 1 of 1

how to make PC Speaker Beep

Posted: Saturday 8th May 2021 6:19pm
by AndyGable
Hi everyone,

I hope someone can help as this is a super simple question

When I try to use beep or system.beep I get a error message saying unknown

how do I get the system to make beep noise from the PC Speaker?

Re: how to make PC Speaker Beep

Posted: Saturday 8th May 2021 8:27pm
by BruceSteers
install beep
sudo apt-get install beep

then use shell in gambas to run it...
Shell "beep"

Re: how to make PC Speaker Beep

Posted: Saturday 8th May 2021 8:45pm
by vuott
AndyGable wrote: Saturday 8th May 2021 6:19pm When I try to use beep or system.beep I get a error message saying unknown
...obvious: ".Beep" is not a resource of the "System" Class.


BruceSteers wrote: Saturday 8th May 2021 8:27pm then use shell in gambas to run it...
Shell "beep"
uhmmm... then maybe that might be enough:
Print Chr(7)

Re: how to make PC Speaker Beep

Posted: Sunday 9th May 2021 7:22am
by stevedee
Getting your internal pc speaker (not speakers) to make a sound can be quite tricky.

Voutt's Print Char(7) should work
Using Screen.Print from gb.ncurses should work
Using Bruce's Shell Beep should work

...but none of these worked for me (in the few minutes that I spent trying them) and I think it may be because I need to enable pc speaker via my audio mixer. However, it does not show on my mixer...so good luck with this one!