back| Documentation > API Examples

Speech Functions

Speak Pre-Existing Audio

Initiate speech of an audio from your account.

Speak Text-To-Speech Audio

Create your text & speak audio and speak it in real time.

Enable/Disable Playback Queing

Susequent speech calls can be queued for playback, or not.

Stop and Restart Speech

A simple example demonstrating basic speech controls.

Preload Audio

When timing is critical, you may want to pre-load your audio.

Preload Text-To-Speech

When timing is critical, you may want to pre-load your TTS audio.

Adjust Audio Volume

Control the volume of speech.

Silent Mock Speech

This can be useful to get users’ attention before audio is enabled.

Overcome the Audio Time Limit

Play multiple audios in sequence, to speak longer or to achieve a tailored message.

Overcoming the TTS Character Limit - Example 1 Overcoming the TTS Character Limit - Example 2

Play multiple TTS audios in sequence, to speak a longer text

Using Your Artificial Intelligence Bot

How to set up your AI Agent, using the API.

Animation Control Functions

Control Your Character's Gaze

Make the character look in any direction

Set Your Character’s Cursor Tracking

Your character can follow the cursor – you can control how

Control Facial Movement

Limit or enhance your character’s facial movements.

Control Facial Expressions

Modify your 3D character’s facial expressions

Control Blink Frequency

Set the (average) blink interval, or turn off blinking entirely

Manage Scene Attributes

Modify Your Character’s Colors

Update skin, hair, lips and eye color (2D character only)

Update Your Scene’s Background Image

Scene background can be modified programmaticly

Modify Your Scene’s Background Color

Affects the color behind the character, and also while loading

Modify Display Settings for Play Controls

Use setStatus to determine when controls are shown

Get Scene Attributes

Certain Scene attributes can be read via this API call.

Responsive Design

Responsive Embed

See Scene responsive behavior when enabling 'Responsive' embed attribute.

Resize Scene Without Reloading It – Example 1

This is useful for responsive design

Resize Scene Without Reloading It – Example 2

This is useful for responsive design


Using Callbacks

Callbacks allow you to synchronize your page with character speech


Add Audio Effects to TTS

Add voice filters to your Text-To-Speech audio to create useful effects

Embed Overlay

Use the API to show & hide a character embedded over the page (Full Body only)

Check Whether Character is 3D

This can be useful to determine whether facial expressions can be applied.

Navigation Flow Functions

Select Which Scene to Load Into Each Portal

With multiple Scenes on the page, you can control what loads where.

Load and Unload a Scene

Use the API to load the Scene, then unload it.

Playback Navigation of Scenes in a Show

Demonstrates show playback navigation – Available for Studio only.

Advanced API Examples

Context Dependent Greeting

Cookie Based Messaging

Use cookies to greet visitors with a different message on each subsequent visit

Time Sensitive Greeting – Using TTS

Greet your visitors according to the time of day

Time Sensitive Greeting – Using Pre-Recorded Audio

Greet your visitors according to the time of day

Time & Day Sensitive Greeting

Greet your visitors according to both time & day of the week.

WebRTC Video

WebRTC Example

Implement real time video delivery using WebRTC

WebRTC Example Using RealTime TTS

Implement video delivery using WebRTC, combining real time text input

Other Examples

SitePal Conversation

Two characters have a conversation

SitePal Conversation And Video Background

Two characters chatting in front of video background

Implement Captions for TTS Speech

How to implement captions using the vh_audioProgress() event

Belated Load Example

Demonstrating how to use your character in a popup dialog

Simple FAQ

Create a “frequently asked questions” implementation

Integrate Speech Recognition with an AI Bot

Have a chat with your AI Bot via Speech-To-Text (implemented using Web Speech API)