Search code examples
javascriptwavsoundmanager2

Soundmanager will not play a sound


function doclick(){  
    soundManager.createSound({
        id: 'mySound',
        url: 'http://localhost/htmlshooter/wav/gun.wav',
        autoLoad: true,
        autoPlay: true,
        volume: 100
    });

    mySound.play();
}

First it says:

SMSound._onload(): "mySound" failed to load? - http://localhost/htmlshooter/wav/gun.wav SMSound.play(): "mySound" is starting to play SMSound.play(): "mySound" is loading - attempting to play..

And then:

soundManager.createSound(): mySound exists soundManager.createSound(): mySound (http://localhost/htmlshooter/wav/gun.wav)

But in fact, its not playing any sound at all.


Solution

  • I dont think Soundmanager2 plays Wav files. You could try enabling HTML5 support on SM2 maybe?