Sound Play Issue

43 views
Skip to first unread message

Awadh Kishore

unread,
Jun 14, 2017, 3:17:39 AM6/14/17
to CreateJS Discussion
I try to play a game in android web view in mobile locally. But problem is that audio is not getting played at all. Actually Mozilla browser agent is used.


Codes written is as following.
var assetsPath = "";
manifest = [
{id: "ballhitground", src: "./sounds/ballhitground.ogg"},
{id: "bathitball",    src: "./sounds/bathitball.ogg"},
{id: "stadium",       src: "./sounds/stadium.ogg"},
{id: "strokes",       src: "./sounds/strokes.ogg"},
      

{id: "effectimg",   src: "img/effectimg.png"},
{id: "effectimg1",   src: "img/effectimg1.png"},
{id: "effectimg2",   src: "img/effectimg2.png"},

];
               

             // preload.getResult('gameplaybtn');
createjs.Sound.alternateExtensions = ["mp3"];
                preload = new createjs.LoadQueue(false, assetsPath);
                window.preload=preload;
preload.installPlugin(createjs.Sound);
preload.addEventListener("complete", doneLoading); // add an event listener for when load is completed
preload.addEventListener("progress", updateLoading);
preload.loadManifest(manifest);

        //===========
        window.soundsObj.stadium=createjs.Sound.play("stadium");
        window.soundsObj.stadium.play();
        window.soundsObj.stadium.volume = 0.35;

Thanks!

Colin Holgate

unread,
Jun 14, 2017, 7:01:18 PM6/14/17
to CreateJS Discussion
I've always put the alternateExtensions line before the manifest is set. I doubt that it will matter. I also use MP3 as the main choice, and OGG as the alternative. Again, that shouldn't matter.

Are you sure that you have all the OGG and MP3 files available in the same folder?

Awadh Kishore

unread,
Jun 19, 2017, 8:26:46 AM6/19/17
to CreateJS Discussion

Awadh Kishore

unread,
Jun 19, 2017, 9:41:27 AM6/19/17
to CreateJS Discussion
Yes I am very much sure I have put those extensions in the same folder. Even though it got play on android browser but not in android webview locally.
Reply all
Reply to author
Forward
0 new messages