Using the sound from Ocaml

Hello,
I’m currently coding a little video game in Caml using the Graphics module and I need to use the sound.
I’m running my code on VSCode which is installed on a virtual machine powered by Debian.
It seems that the sound is working on the virtual machine so I thought it may be the command used in Caml which is not right (sound frq dur).
If this command is not rigth is there a way to play a sound without using another package?
Could anyone provide help?

Thank you very much :slight_smile:

The graphics library is using the bell character to produce sound. If it works, you should hear a beep. But, pitch control for bell character does not work reliably.

However, even if it worked Graphics.sound is an extremely limited API for producing sound since it provides only one channel with the possible smallest duration of one second for a pure pitch sound.

It is better to switch to another library for producing sound. For instance, the tsdl library exposes the audio part of the SDL library. You could also use the portaudio library if you wish to keep using graphics for the graphical part.