I was guessing:
It might due to some restriction browser communicate with operating system.
Normally, browser is not suppose to communicate with operating system directly.
The sound device is a hardware, so it need operating system to control the hardware.

However, I am not sure about it. And the code I used to generate sound was adopted from very old java version.
I did not study how it can be done with latest java version.