Led76 Posted December 15, 2017 Share Posted December 15, 2017 I am trying to load three sounds sprites into my app's Webview (needless to say this works well in Chrome/Firefox etc). The app is in PIXI. var sound = new Howl({ src: ['sound.mp3'], sprite: { audio: [0,350], brush: [350, 16150], notep: [16500, 691] } }); I play the sounds like this: sound.play('brush'); Instead of hearing the 3 sounds, the whole file is played once. Then if I play the first or the second sound I hear the whole sound file (all 3 sounds). The third one is played correctly after the whole file is played once. Does it have to do with Android's assets? I just use this code in Android Studio, nothing else: WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); webView.loadUrl("file:///android_asset/index.html"); Anyway, is there any working code, any very simple example I may use for this task? I have lost 2 days for just playing with these three sounds. If there is any other workaround I would be happy to try... Many thanks Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 15, 2017 Share Posted December 15, 2017 Post it here: https://github.com/goldfire/howler.js/issues Or you can try use https://github.com/pixijs/pixi-sound Quote Link to comment Share on other sites More sharing options...
Led76 Posted December 15, 2017 Author Share Posted December 15, 2017 Hi Ivan.Thanks for the reply. I have tried to use pixi-sound but still had no luck with Webview (all good in Chrome/Firefox). The problem is that I can only load one file, the others are just ignored/not played at all. Do you have any working example? Regards Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 15, 2017 Share Posted December 15, 2017 @bigtimebuddy I summon you! Quote Link to comment Share on other sites More sharing options...
Led76 Posted December 15, 2017 Author Share Posted December 15, 2017 I know the issue is very common in Webview, especially in HTML5/JS mobile apps, and probably doesn't have to do with any of the sound libraries but I am sure there must be a way to solve it somehow. The one file limitation is very annoying. Has anyone developed a web app with >1 sound files using PIXI in Android's webview? Quote Link to comment Share on other sites More sharing options...
canyonkarl Posted December 15, 2017 Share Posted December 15, 2017 Hi @Led76 PixiSound also supports sound sprites, like Howler. You can see the example here: http://pixijs.io/pixi-sound/examples/sprites.html With older Android Webview containers, you cannot multitrack audio. You can only have one audio file loaded at a time. If you're building an app, there are many options out there for embedding a Chrome Webview (with more modern features). For instance, if you're using Cordova to build your app, you can use CrossWalk to do this. Quote Link to comment Share on other sites More sharing options...
Led76 Posted December 17, 2017 Author Share Posted December 17, 2017 Hi canyonkari. I will try to find a solution with the webview, if not I will switch to Cordova. Many thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.