Jump to content

Audio Loading Issue using Pixijs


awadh
 Share

Recommended Posts

Hi all of you!,

 

       Could anybody give me the solution while loading audio in safari browser issue as following.

 

 

these are the audio files in local drive

pixi.min.js:14Pixi.js 4.0.1 - Canvas - http://www.pixijs.com/
pixi.audio.js:1TypeError: 'undefined' is not a constructor (evaluating 'new window.Audio')

Regards,

Awadh

Link to comment
Share on other sites

var loader = PIXI.loader;    
 

         loader.add([

             
               {name:"bgsound",    url:["audio/bg.mp3","audio/bg.ogg"]},
               {name:"startSound", url:["audio/starting2.mp3","audio/starting2.ogg"]},
               {name:"normal",     url:["audio/woodSound.mp3","audio/woodSound.ogg"]},
               {name:"shrink",     url:["audio/shrink4.mp3","audio/shrink4.ogg"]},
               {name:"perfect1",   url:["audio/perfect1.mp3","audio/perfect1.ogg"]},
               {name:"perfect2",   url:["audio/perfect2.mp3","audio/perfect2.ogg"]},
               {name:"perfect3",   url:["audio/perfect3.mp3","audio/perfect3.ogg"]},
               {name:"perfect4",   url:["audio/perfect4.mp3","audio/perfect4.ogg"]},
               {name:"perfect5",   url:["audio/perfect5.mp3","audio/perfect5.ogg"]},
               {name:"perfect6",   url:["audio/perfect6.mp3","audio/perfect6.ogg"]},
               {name:"failure",    url:["audio/failure3.mp3","audio/failure3.ogg"]}

          ])
          .on("progress", loadProgressHandler)
          .load(setup);

 

 

function setup(){

    //start the game init code

}

Edited by awadh
missing detailing
Link to comment
Share on other sites

The issue is only on the safari browser

 

Pixi.js 4.0.1 - Canvas - http://www.pixijs.com/
XMLHttpRequest cannot load http://103.35.164.71/v3/game/high/score/?userid=null&gameid=null. Origin http://localhost is not allowed by Access-Control-Allow-Origin.
pixi.audio.js:1TypeError: 'undefined' is not a constructor (evaluating 'new window.Audio')
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...