I used codepen because I wanted to control what libs I was pulling in. If you look in the console you should see the error: “Uncaught TypeError: Cannot read property ‘canUseWebAudio’ of undefined”.
I know with chrome you have to allow it to play sound, so there should be a small pop up in the upper right corner. That’s what the playground does, anyway. Lets ask @Deltakosh
EDIT: I modded you codepen. copy-paste this to overwrite your javascript
var canvas = document.getElementById("canvas");
var createScene = function () {
var scene = new BABYLON.Scene(engine);
var music = new BABYLON.Sound("Violons", "https://www.babylonjs-playground.com/sounds/violons11.wav", scene, null, { loop: true, autoplay: true });
return scene;
};
__createScene = createScene;
var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true });
var scene = createScene();
engine.runRenderLoop(function () {
if (scene) {
scene.render();
}
});
It seems that the third argument to the engine constructor does the trick. Even if you pass an empty object {} it works with the inital example provided by @tkmoney.