Zackorz Posted July 13, 2015 Share Posted July 13, 2015 Hi Guys, i created a html5 animation for testing all different browsers and devices. So far the animation is working, but in "Opera" browser i have no sound. Somebody know this issue ? Here is how i implemented my sound:function preload() { game.load.audio("watersound", "assets/music.mp3");}function create() { music = game.add.audio("watersound"); music.play();} Link to comment Share on other sites More sharing options...
Zackorz Posted July 13, 2015 Author Share Posted July 13, 2015 Nobody an idea? I tested now the "sound code examples" on the phaser website. They also didnt work in opera :-( Link to comment Share on other sites More sharing options...
Zackorz Posted July 14, 2015 Author Share Posted July 14, 2015 Ok, i fixed the "problem". If somebody is interested in the solution: Opera needs ".ogg-files" and cant play ".mp3files." Link to comment Share on other sites More sharing options...
Noid Posted July 14, 2015 Share Posted July 14, 2015 If you offer both mp3 and ogg, make sure you put ogg files first in the array. When asked about mp3 support Opera answers "probably"(not joking) so phaser will try to play the mp3 files if they're first in the array. https://github.com/photonstorm/phaser/issues/1718 You probably want to offer both if you want audio to work on IE and/or Safari. Rhyllgar and Zackorz 2 Link to comment Share on other sites More sharing options...
Zackorz Posted July 14, 2015 Author Share Posted July 14, 2015 Ahh, didnt realized that IE had no sound with the ogg file. Works now on all browsers with your "workaround". Thank you :-) Link to comment Share on other sites More sharing options...
Recommended Posts