The code you write is running on a server. Somewhere. In the "Cloud". The code is not run on your machine, so the sound would not come from your machine.
Unless you create an HTML file, that is interpreted by the browser running on your machine...
If you copy the code and compile it and run it on your machine, then you're good.