Is it possible to let kotlin (ktor) make a beeping...
# server
g
Is it possible to let kotlin (ktor) make a beeping sound on the terminal output? On MacOs I could just print:
say "hello"
but when I print this with kotlin it is not working, I also tried
afplay /System/Library/Sounds/Ping.aiff
which is working in terminal, but not when using println or logger.info()
c
println() just prints characters to the screen. Probably you want to run an actual command: https://www.baeldung.com/run-shell-command-in-java
g
Thanks! Fixed it with
Runtime.getRuntime().exec()
p
Depending on your terminal & environment, writing a
BEL
to stdout will sometimes trigger an audible beep: https://en.wikipedia.org/wiki/Bell_character
233 Views