Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi,
I don't have much experience with Vuforia Studio or javascript. I am trying to narrate each step in an animation with text-to-speech. I have the desired narration script in an array and I wanted to use the currentStep variable to step through the narration array. I am unable to get the currentStep variable to register. I have used the console log to monitor the state of the currentStep but the state never changes even while the animation is playing.
I am using Vuforia Studio 9.11.4.0
Solved! Go to Solution.
playAudio = function() {
var audio = new Audio('app/resources/Uploaded/Flying.wav');
audio.play();
};
$scope.$on('stepstarted', function(event, targetID, unused_targetType, data) {
// Check to make sure this event applies to the correct model.
// since angular events are broadcast from the root scope we may get events pertaining to other twx-dt-models.
var stepInfo = JSON.parse(data);
console.log("stepNumber "+stepInfo.stepNumber);
console.log("stepName "+stepInfo.stepName);
console.log("totalSteps "+stepInfo.totalSteps);
console.log("nextStep "+stepInfo.nextStep);
playAudio();
});
playAudio = function() {
var audio = new Audio('app/resources/Uploaded/Flying.wav');
audio.play();
};
$scope.$on('stepstarted', function(event, targetID, unused_targetType, data) {
// Check to make sure this event applies to the correct model.
// since angular events are broadcast from the root scope we may get events pertaining to other twx-dt-models.
var stepInfo = JSON.parse(data);
console.log("stepNumber "+stepInfo.stepNumber);
console.log("stepName "+stepInfo.stepName);
console.log("totalSteps "+stepInfo.totalSteps);
console.log("nextStep "+stepInfo.nextStep);
playAudio();
});