I'm looking to use multiple audio files in a tizen wearable web app. It works for 1 audio but no matter what i try it doesn't work for multiple.
I've tried declaring multiple audio files and then passing them as a variable to a function with no luck.
var sound1 = new Audio("audio/first_file.wav");
sound1.loop = false;
sound1.volume = 15.0;
var sound2 = new Audio("audio/second_file.wav");
sound2.loop = false;
sound2.volume = 15.0;
function startSample(sound) {
sound.play();
tizen.feedback.stop();
}
I've tried declaring the audio file within the function
var sound1 = "audio/first_file.wav";
var sound2 = "audio/second_file.wav";
function startSample(sound) {
var soundSample = new Audio(sound);
soundSample.loop = false;
soundSample.volume = 15.0;
sound.play();
tizen.feedback.stop();
}
I even tried giving them separate functions, but it seems even with only one audio, declaring the audio variable within a function does not work.
function soundSample1() {
var sound1 = new Audio("audio/first_file.wav");
sound1.loop = false;
sound1.volume = 15.0;
sound.play();
tizen.feedback.stop();
}
The one thing that does work is this, but only when there's only one audio file.
var sound1 = new Audio("audio/first_file.wav");
sound1.loop = false;
sound1.volume = 15.0;
function startSample() {
sound1.play();
tizen.feedback.stop();
}
Any help would be greatly appreciated.