Skip to content
forked from johnath/beep

Linux Console Beep for WSL Ubuntu and OpenSUSE in Windows 10 and Cygwin. Links to songs.

License

Notifications You must be signed in to change notification settings

mobluse/wsl-beep

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wsl-beep

Beep for WSL Ubuntu and OpenSUSE in Windows 10, and Cygwin. The built-in beep in Ubuntu/OpenSUSE doesn't work in WSL (Windows Subsystem for Linux), but I've modified it to use Windows Beep() e.g. powershell.exe "[console]::beep(261.6,700)". In a WSL Linux the frequency must be between 37.0 and 32767.0 Hz, but it pauses the right time if the frequency is less than 37.0. The original beep supported floating point frequences, but in Windows they are probably truncated to integers.

Build and install in Ubuntu, Cygwin and OpenSUSE using:

make
sudo make install

In Cygwin you need to leave out sudo. In OpenSUSE you have to also do:

unalias beep
export PATH=$PATH:/mnt/c/Windows/System32/WindowsPowerShell/v1.0

Then you can try beep -f 261.6 -l 700. To read the manual using man beep doesn't work well in OpenSUSE for unknown reasons.

This makes it possible to play the files in https://github.com/ShaneMcC/beeps or https://github.com/Josef-Friedrich/beep-melodies or the command-lines in https://www.reddit.com/r/linux/comments/18h8v5/does_anyone_have_or_know_a_source_for_beep_scripts/.

You can break out of the playing scripts by pressing Ctrl+C for a long time.

Now I use system(), but one might use a more direct call with less overhead, but I don't know how. Another alternative would be to write a TCP/IP sound server.

It is possible to install this beep without compiling using a repository: https://github.com/cerebrate/wsl-translinux.

See also: https://www.reddit.com/r/bashonubuntuonwindows/comments/7x26us/linux_console_beep_for_wsl_ubuntu_and_opensuse_in/.

About

Linux Console Beep for WSL Ubuntu and OpenSUSE in Windows 10 and Cygwin. Links to songs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.6%
  • Makefile 4.4%