i am unfamiliar with JavaScript, and wanted to add an mp3 file to play when the wikitude world starts, however it is not playing. there is no audio,
i used the tutorials on the wikitude website to add wikitude as part of an Android app.
documentation for class sound of wikitude sdk
http://www.wikitude.com/external/doc/alr/Sound.html
here is the code selection for the audio
streamingSound = new AR.Sound("assets/soundtest.mp3", {
onError : errorLoadingSound,
onFinishedPlaying : readyToPlay,
onLoaded : readyToPlay,
});
streamingSound.load();
streamingSound.play();
here is the full code for the file multiplepois.js
var World = {
markerDrawable_idle: new AR.ImageResource("assets/lion.png"),
// New: a second image resource which represents a selected marker
markerDrawable_selected: new AR.ImageResource("assets/marker_selected.png"),
// New: a array holding a reference to all marker objects
markerList: [],
init: function initFn() {
AR.context.onLocationChanged = World.onLocationChanged;
// New: a custom callback which will be invoked when the user taps on an empty screen space
AR.context.onScreenClick = World.onScreenClick;
},
onLocationChanged: function onLocationChangedFn(latitude, longitude, altitude, accuracy) {
AR.context.onLocationChanged = null;
streamingSound = new AR.Sound("assets/soundtest.mp3", {
onError : errorLoadingSound,
onFinishedPlaying : readyToPlay,
onLoaded : readyToPlay,
});
streamingSound.load();
streamingSound.play();
}
// New: Markers are now created using the new operator.
// The marker definition is in `marker.js`.
// Title, description and location are supplied in the json compatible format
var poiData = {
"latitude": 31.580,
"longitude": 130.545,
"altitude": altitude,
"title": "Marker 1",
"description": "forever office"
};
World.markerList.push(new Marker(poiData));
poiData = {
"latitude": latitude,
"longitude": longitude - 0.5,
"altitude": altitude,
"title": "Marker 4",
"description": "West"
};
World.markerList.push(new Marker(poiData));
},
onScreenClick: function onScreenClickFn() {
for (var i = World.markerList.length - 1; i >= 0; i--) {
if (World.markerList[i].isSelected) {
World.markerList[i].setDeselected(World.markerList[i]);
}
}
}
};
World.init();