!function(){function o(o){if(o.urls&&!(o.urls.length<2))for(var t=o.urls[0],i=1;i<o.urls.length;i++){var e=o.urls[i];"."==e[0]&&(o.urls[i]=t.replace(/\.[^./]+$/,e))}}function t(){var o=window.location.pathname,t=o.substring(0,o.lastIndexOf("/"))+"/";console.log(t);return t}function i(t){QyEventTarget.call(this);t||(t={});if(t.background){this.is_background=!0;null==t.loop&&(t.loop=!0)}this.loop=t.loop;for(var i=0;i<e.length;i++){var n="sound"+e[i];if(t[n]){gmx_listen(this,e[i],t[n]);delete t[n]}}o(t);try{if(qyengine.isApk){this.initCordovaAudio(t);this.setVolume(t.volume)}else this.initHowl(t)}catch(s){console.log(s)}}window.QyEventTarget=function(){};PIXI.EventTarget.mixin(QyEventTarget.prototype);var e=["ends","load","loaderror","pause","play"];inherits(i,QyEventTarget);window.QySound=i;if(qyengine.isApk){i.prototype.play=function(){if(this.cordovaAudio){this.shouldStop=!this.loop;this.cordovaAudio.play()}};i.prototype.pause=function(){this.cordovaAudio&&this.cordovaAudio.pause()};i.prototype.stop=function(){if(this.cordovaAudio){this.shouldStop=!0;this.cordovaAudio.stop()}};i.prototype.mute=function(){if(!this._muted){this._muted=!0;this.oldVolume_=this.volume_;this.setVolume(0)}};i.prototype.unmute=function(){if(this._muted){this._muted=!1;null!=this.oldVolume_&&this.setVolume(this.oldVolume_)}};i.prototype.unload=function(){this.cordovaAudio&&this.cordovaAudio.release()};i.prototype.setVolume=function(o){o>=0&&1>=o||(o=1);this.volume_=o;this.cordovaAudio&&this.cordovaAudio.setVolume(o)};i.prototype.getVolume=function(){return this.volume_};i.prototype.getActiveNode=function(){return this._activeNode}}else{object_extend(i,Howler);i.prototype.getActiveNode=function(){this.howl||this.initHowl();return this.howl&&this.howl._activeNode()};i.prototype.setVolume=function(o){this.howl&&this.howl.volume(o)};i.prototype.getVolume=function(){this.howl&&this.howl.volume()};i.prototype.setLoop=function(o){o=!!o;this.loop=o;this.howl&&this.howl.loop(o)};!function(){function o(o){i.prototype[o]=function(){this.howl&&this.howl[o]()}}for(var t=["play","pause","stop","mute","unmute","unload"],e=0;e<t.length;e++)o(t[e])}()}i.prototype.initCordovaAudio=function(o){var i=t()+o.urls[0],e=this;this.cordovaAudio=new Media(i,void 0,function(o){console.log(i+":Audio Error: "+JSON.stringify(o))},function(o){switch(o){case Media.MEDIA_NONE:break;case Media.MEDIA_STARTING:e._activeNode=e;break;case Media.MEDIA_RUNNING:e.onplay();break;case Media.MEDIA_PAUSED:e.onpause();break;case Media.MEDIA_STOPPED:if(e.shouldStop){e._activeNode=null;e.onend()}else e.cordovaAudio.play()}})};i.prototype.initHowl=function(o){this.howl=new Howl(qyengine.addToObj({onend:this.onend.bind(this),onload:this.onload.bind(this),onloaderror:this.onloaderror.bind(this),onpause:this.onpause.bind(this),onplay:this.onplay.bind(this)},o))};i.prototype.onend=function(){this.dispatchEvent("soundend")};i.prototype.onload=function(){this.dispatchEvent("soundload")};i.prototype.onloaderror=function(){this.dispatchEvent("soundloaderror")};i.prototype.onpause=function(){this.dispatchEvent("soundpause")};i.prototype.onplay=function(){this.dispatchEvent("soundplay")}}();