graphics icon indicating copy to clipboard operation
graphics copied to clipboard

sound command is not working

Open Neutralino2007 opened this issue 1 year ago • 8 comments

It seems that the sound command is not working. It produces no sound even if executes from multiples OS with diverse Ocaml installations. Is there a specif reason or is this just a bug?

Neutralino2007 avatar May 12 '24 22:05 Neutralino2007

Hello, thank you for your report. However, precise reproduction instructions are needed in order to investigate any issue: what exact system are you using, how exactly did you try to use Graphics, what was the output (if any), etc.

nojb avatar May 12 '24 22:05 nojb

I ran my code on VSCode which is installed on virtual machine powered by Debian. Whenever I tried to execute the sound command, the code would compile correctly with no errors or abnormal output. It would just not produce the sound. I checked everything audio parameter and configuration and everything is fine. The problem really seems to come from sound if I'm not mistaken. Have I given enough data?

Neutralino2007 avatar May 13 '24 08:05 Neutralino2007

Did you open a graphics windows before using Graphics.sound? How is the system bell configured in your system? Can you hear the system bell?

Octachron avatar May 13 '24 08:05 Octachron

I opened a graphic window before using the command. I can hear the bell if testing the sound with speaker-test tests this parameter. How can I check the bell configuration if it's not this?

Neutralino2007 avatar May 13 '24 08:05 Neutralino2007

As far as I can see speaker-test does not have an option to test the system bell? You can try

echo -e "\a"

in a terminal. However, it is important to note that Graphics.sound is not really a useful function; and I would be in fact in favor to deprecate it.

Octachron avatar May 13 '24 08:05 Octachron

Graphics.sound might still work under Windows, but the X11 implementation based on XBeep seems to have stopped working a while ago. With Ubuntu 22.04 and with macOS, I get a standard terminal beep, but pitch and duration are ignored.

xavierleroy avatar May 13 '24 09:05 xavierleroy

(For Ubuntu: remember to un-mute "System Sounds" in the Sound settings.)

xavierleroy avatar May 13 '24 09:05 xavierleroy

Ok, thank you very much for your answers ! I took into account what you said. However, I confirm definitively that it's not working for Debian... If Graphics.sound is not working, I'll, maybe, search for another solution if it exists. Thanks

Neutralino2007 avatar May 13 '24 12:05 Neutralino2007