Jump to content

Advice on audio in Cordova and crosswalk


liorfrenkel
 Share

Recommended Posts

Hey,

the music for my game is 2:00 minutes long, when I wait for it to decode on the desktop in all browsers it is bearable, 
but with cordova + crosswalk it is much much longer, 

I tried using https://github.com/floatinghotpot/cordova-plugin-nativeaudio , but it doesn't work well for me, the sound on android is delayed much more than using the phaser sound, and it sometimes simply doesn't work... stuck etc.

any advice on this subject?

Thanks a lot!

Link to comment
Share on other sites

Hi, if your problem is with Android decoding, there was bug in Chromium for very long time: https://bugs.chromium.org/p/chromium/issues/detail?id=424174

What I did in my games was, that I downloaded sounds and some short menu music which is decoded in reasonable time. All ingame music is loaded in background with custom Phaser.Loader instance.

Also word of warning with that Cordova plugin: do not use it for iOS version - it caused problems for me when suspending / resuming game (freezing). I the end I removed it also from Android version, but to be honest, I do not remember reason (but I think, there were some problems too - watch logcat)

Link to comment
Share on other sites

14 hours ago, liorfrenkel said:

Hey,

the music for my game is 2:00 minutes long, when I wait for it to decode on the desktop in all browsers it is bearable, 
but with cordova + crosswalk it is much much longer, 

I tried using https://github.com/floatinghotpot/cordova-plugin-nativeaudio , but it doesn't work well for me, the sound on android is delayed much more than using the phaser sound, and it sometimes simply doesn't work... stuck etc.

any advice on this subject?

Thanks a lot!

Use the music a small bitrate and frequency

Link to comment
Share on other sites

11 hours ago, icp said:

You could try HowlerJS instead of Phaser's default sound manager.

does it decode faster than phaser's?

I actually managed to use the cordova plugin I mentioned before and by changing the encoding method I used for my mp3 (https://www.freac.org/), and not using the plugin's "preloadSimple" function,  the problem was solved, at least on android, haven't checked on ios yet. 

thanks!

Link to comment
Share on other sites

13 hours ago, liorfrenkel said:

does it decode faster than phaser's?

I actually managed to use the cordova plugin I mentioned before and by changing the encoding method I used for my mp3 (https://www.freac.org/), and not using the plugin's "preloadSimple" function,  the problem was solved, at least on android, haven't checked on ios yet. 

thanks!

Yes.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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