Skip to content

Commit

Permalink
add callback function to motion and speak
Browse files Browse the repository at this point in the history
  • Loading branch information
RaSan147 committed Apr 17, 2024
1 parent 18f7c36 commit ea3de0e
Show file tree
Hide file tree
Showing 5 changed files with 2,294 additions and 9,613 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,20 @@ model.stopSpeaking()
model.stopMotions()
```

## Use callback function after a voiceline is over
* Demo code
```js
model.speak(audio_link, {volume: volume,
onFinish: () => {console.log("Voiceline is over")},
onError: (err) => {console.log("Error: "+err)} // [if any error occurs]
})

model.motion(category_name, animation_index, priority_number, {sound: audio_link, volume: volume, expression:expression,
onFinish: () => {console.log("Voiceline and Animation is over")},
onError: (err) => {console.log("Error: "+err)} // [if any error occurs]
})
```

## Totally destroy the model
* This will also stop the motion and audio from running and hide the model
* Demo code
Expand Down
Loading

0 comments on commit ea3de0e

Please sign in to comment.