Welcome to the official Javascript client for Emotech's Digital Assistant API's. The system works with three modular API's/clients:
- ASR: Automatic Speech Recognition for talking with the avatar.
- emoDA: The client which controls things like:
- The avatar selection
- What language it speaks (English, Arabic msa, Arabic ksa, Arabic egypt)
- What the avatar says
- Background
To help get started using the DA API's various examples are provided in the examples/
directory:
asr_example.html
: A simple example of interacting with the ASR endpoint. Click to record audio and the transcript is displayed.da_example.html
An example of all the DA functionality splat onto one webpage. This webpage is intended just as a demo of everything thats offered rather than how a webpage using the avatar might look. It serves as a useful reference for using each feature of the DA.
First you will need an apikey, same apikey can be use to run both asr and da.
Once you have API key, go to asr_example.html
and da_example.html
, replace this line here:
And then run this command below: npx http-server -c-1
You will see this in the command line window:
Go to http://127.0.0.1:8080, you will see:
If it run successfully, you will see a website like this and you can try out basic DA function here:
To reduce latency, we recommend using a Digital Avatar (DA) deployed closer to your region. Emotech provides two deployment options:
- 🇬🇧 London Deployment (default)
- 🇦🇪 UAE Deployment (Down)
By default, the DA will start with the London deployment. If you prefer to use the UAE deployment, contact emotech team as UAE deployment has been shut down due to resrouce limitation. Once UAE deployment is up, follow the steps below.
-
Open the following files:
emoASRV2.js
emoDA.mjs
-
Search for the following variables in both files:
this.requestUrl
this.wsUrl
-
Comment out the London URLs and uncomment the UAE URLs (or vice versa), depending on your preference.
⚠️ Important: Make sure to update bothrequestUrl
andwsUrl
at the same time to avoid mismatched configurations.