cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Using currentStep to Narrate an Animation with Text-to-Speech

KW_10715455
1-Newbie

Using currentStep to Narrate an Animation with Text-to-Speech

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

 

 

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();



});

View solution in original post

1 REPLY 1

 

 

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();



});
Top Tags