Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

sound in android using cordova (intel XDK)


1ipt0n
 Share

Recommended Posts

Hi.

I'm using intel XDK to make android games in phaser and I want to add some sound and music.

first I've done it with Phaser.Sound but it have one downside. when You minimalize window with game or lock phone music is still playing :)

 

so I've tried intel XDK way using

intel.xdk.player.playSound(soundURL);

 
It's working nice in intel XDK emulator, but it;s not working at all in android .
 
So how to do it right to work on android? and if it's possible olso in ios and windows phone?
Link to comment
Share on other sites

  • 2 months later...

Hi,

 

You can use the Cordova Media plugin. Projects Tab -> Plugins -> Standard Cordova Plugins (left panel) -> check 'Media' plugin. 

Link to their documentation: https://github.com/apache/cordova-plugin-media

It supports a variety of platforms including Android, iOS and Windows. 

 

If you want to play two sound files simultaneously, like an action sound with background music, I would suggest the Low Latency Native Audio plugin (https://github.com/floatinghotpot/cordova-plugin-nativeaudio)

 

Please post any subsequent Intel XDK related questions on the Intel XDK user forum for best response. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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