Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support default audio device #19

Open
federico-razzoli opened this issue Sep 29, 2021 · 1 comment
Open

Support default audio device #19

federico-razzoli opened this issue Sep 29, 2021 · 1 comment

Comments

@federico-razzoli
Copy link

Since hardware vendors decided for us that we don't like the system bell, it would be great to have a way to beep via the default audio device.

If you want to keep beet simple for systems with a real bell, maybe you would consider having a separate binary that uses the system bell. If for some reason some options won't work with the default audio, it will still be fine for me.

@ndim
Copy link

ndim commented Sep 30, 2021

A few remarks:

  • beep is explicitly the user interface to the PC speaker, so audio devices are outside its focus.

  • This implementation of beep has not experienced maintenance for a few years (last commit was in February 2013), which is why I have forked it over at https://github.com/spkr-beep/beep where I do maintain it. https://github.com/spkr-beep/beep/blob/master/PACKAGING.md contains a link to the repology.org beep page and the overview graphic showing which Linux distributions have picked up the spkr-beep beep (look for beep versions 1.4 and newer).

  • Modern user interfaces like e.g. Gnome and Gnome Terminal often can generate beeps (through the audio system) for e.g. pressing backspace in a terminal window at the beginning of the line where there is no going "back", but choose to be silent by default.

  • Laptops and other integrated machines often route the PC speaker output through some audio mixer to the builtin audio speakers, but the mixer might default to zero volume (see no sound in debian 10 on thinkpad t440p with pulseaudio spkr-beep/beep#13).

  • If you just need a way to output square waves through the PCM audio devices, the play command from SoX can do just that:

    play -n synth 0.3 square 440
    # for a 0.3 second square wave at 440Hz.
    

For single beeps, writing a shell script wrapper for play which maps a beep like command line is easy, and I would not be opposed to carry that in https://github.com/spkr-beep/beep/tree/master/contrib (which, remember, is in my maintained fork of this project). However, for playing complete melodies which consist of a series of notes linked with -n on the beep command line, timing will start to become an issue if you start a new call of play for every note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants