0
Answered

say function to avatar

AND ITALIA 2 years ago in SitePal Platinum updated by Gil Sideman 2 years ago 4

Hello,

I'm try to send an method to the scene, but JS say me is not a function.

This is an example: https://jsfiddle.net/moku23/05ycdsvr/5/

Answer

Answer
Under review

Hello!

There is no function called say me or sayme or say.

There are three main speech functions that you should become familiar with - 

1. sayAudio - to speak previously uploaded or recorded audios

2. sayText - for realtime Text-to-Speech audio

3. sayAI - for user interaction with your SitePal Bot (or 3rd party bot)

To become more familiiar with using our API I recommend reading the introduction section in our Client API reference document on our support page.

Here is a direct link - 

https://www.sitepal.com/docs/vhost_API_Reference.pdf


On our support page - www.sitepal.com/support - you will also find links to dozens of technical examples demonstrating how to use our API. Please peruse those examples, and feel free to copy their source code to your own page to get started.

Regarding the test page you shared above - In your page you are trying to call the function saySilent (please look un in the reference doc what it does). But it will not work before your character has loaded. 

You should use the callback function vh_sceneLoaded to find out when it is safe to call the API.

Finally, if you have specific questions - please send us a note to support@sitepal.com - and we will be happy to look into and advise.

I hope this helps,

Gil

ps. great character!

Answer
Under review

Hello!

There is no function called say me or sayme or say.

There are three main speech functions that you should become familiar with - 

1. sayAudio - to speak previously uploaded or recorded audios

2. sayText - for realtime Text-to-Speech audio

3. sayAI - for user interaction with your SitePal Bot (or 3rd party bot)

To become more familiiar with using our API I recommend reading the introduction section in our Client API reference document on our support page.

Here is a direct link - 

https://www.sitepal.com/docs/vhost_API_Reference.pdf


On our support page - www.sitepal.com/support - you will also find links to dozens of technical examples demonstrating how to use our API. Please peruse those examples, and feel free to copy their source code to your own page to get started.

Regarding the test page you shared above - In your page you are trying to call the function saySilent (please look un in the reference doc what it does). But it will not work before your character has loaded. 

You should use the callback function vh_sceneLoaded to find out when it is safe to call the API.

Finally, if you have specific questions - please send us a note to support@sitepal.com - and we will be happy to look into and advise.

I hope this helps,

Gil

ps. great character!

Ok, but how can I use saySilent(10)?

You want to make sure the call to saySilent (or any other api function) is made after your SitePal character is loaded. To that end, use vh_sceneLoaded callback to verifyScene has loaded before making any API call.


So you can make the call in the callback itself.

Or, make the call in response to user action.

Here's a technical example that demonstrates the latter - 

https://sitepal.com/api/examples/saySilent.html

Hope this helps.

Gil