how to make PC Speaker Beep

Post your Gambas programming questions here.
Post Reply
AndyGable
Posts: 137
Joined: Wednesday 02nd December 2020 12:11am
Location: England
Contact:

how to make PC Speaker Beep

Post by AndyGable » Saturday 08th May 2021 6:19pm

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?

User avatar
BruceSteers
Posts: 652
Joined: Thursday 23rd July 2020 5:20pm

Re: how to make PC Speaker Beep

Post by BruceSteers » Saturday 08th May 2021 8:27pm

install beep
sudo apt-get install beep

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

If at first you don't succeed , try it differently.

vuott
Posts: 97
Joined: Wednesday 05th April 2017 6:07pm
Location: European Union

Re: how to make PC Speaker Beep

Post by vuott » Saturday 08th May 2021 8:45pm

AndyGable wrote:
Saturday 08th 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 08th May 2021 8:27pm
then use shell in gambas to run it...
Shell "beep"
uhmmm... then maybe that might be enough:
Print Chr(7)

User avatar
stevedee
Posts: 455
Joined: Monday 20th March 2017 6:06pm

Re: how to make PC Speaker Beep

Post by stevedee » Sunday 09th May 2021 7:22am

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!

Post Reply