0

I'm playing audio in my HTML5 app using:

createjs.Sound.play('boom-sound');

I then imported the project to Intel XDK. Now the game is playing smoothly in the emulator but the no sounds are there. I also tested after building the app for android and no audio was there.

Any idea, anyone?

Buntu Linux
  • 492
  • 9
  • 19

2 Answers2

0

soundjs does not work that well, I've also had problems making it play sound on IOS devices in the past. To fix this problem I now use howler.js.

VADEMO
  • 41
  • 1
  • 6
  • if it's working, it should work in the xdk Emulator as well right ? and it did not work on it – Buntu Linux Apr 16 '15 at 10:32
  • SoundJS fully supports iOS. If you are still having issues, please report bugs to [github](https://github.com/CreateJS/SoundJS/issues), ask questions here, or join discussion on [reddit](http://www.reddit.com/r/createjs/) and I'll be happy to try to help. – OJay Apr 16 '15 at 16:37
0

SoundJS has run into trouble in environments like Intel XKD and PhoneGap because it defaults to using the WebAudioPlugin. While Web Audio may be available, it needs to load audio through XHR which will not work with local files.

Loading files from an external server would get around this, but require the app to fetch data which is less than ideal. Using createjs.Sound.registerPlugins([HTMLAudioPlugin]) would get around this but HTML audio playback is sometimes limited on mobile devices.

Luckily, SoundJS recently added a CordovaAudioPlugin, and since Intel XDK is based on Cordova this should give you full SoundJS functionality. You'll need to grab the plugin and the latest SoundJS-NEXT from github. Then you can setup the plugin with registerPlugins

createjs.Sound.registerPlugins([CordovaAudioPlugin]);

Hope that helps.

OJay
  • 1,249
  • 7
  • 14