sound command is not working
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?
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.
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?
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?
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?
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.
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.
(For Ubuntu: remember to un-mute "System Sounds" in the Sound settings.)
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