I am working on an application and use IntelXDK to create it. I need to play some sounds if the conditions are met, at first I tried HTML5 with JS and on the desktop, but when building it has no sound ...
First try - HTML5 and JS
<audio src="snd/yes.mp3" id="yes"></audio>
<audio src="snd/no.mp3" id="no"></audio>
if(condition) {
$('#yes').trigger("play");
} else {
$('#no').trigger("play");
}
Then I tried the built-in version of IntelXDK, which looks like this:
if(condition) {
intel.xdk.player.playSound("snd/yes.mp3");
} else {
intel.xdk.player.playSound("snd/no.mp3");
}
Not only does it not work, but also the rest of my code does not allow a popup and page change to be triggered.
Does anyone know how to fix this? Do I need to preload sounds before playing them?
** UPDATE
, HTML5 Audio, , , snd, ... ?