how to make PC Speaker Beep

Post your Gambas programming questions here.
Post Reply
AndyGable
Posts: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

how to make PC Speaker Beep

Post 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?
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: how to make PC Speaker Beep

Post by BruceSteers »

install beep
sudo apt-get install beep

then use shell in gambas to run it...
Shell "beep"
If at first you don't succeed , try doing something differently.
BruceS
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: how to make PC Speaker Beep

Post 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)
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: how to make PC Speaker Beep

Post 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!
Post Reply