Skip to content

ernepriv/RealtimeAvatarDemoV2

 
 

Repository files navigation

HeyGen Icon

Realtime Avatar Streaming Demo

This demo showcases the capabilities of HeyGen's Realtime Avatar API, allowing you to stream real-time avatars with ease.

Before getting started, please make sure you have the necessary prerequisites in place and follow the steps outlined below to run and explore this demo.

Pre-Requisites

  • Apply for access as a real-time avatar whitelist user.
  • Node.js and npm installed on your system.
  • API key from HeyGen.

Getting Started

Follow these steps to run the demo:

  1. Clone the repository to your local machine:

    git clone https://github.com/HeyGen-Official/RealtimeDemoV2.git
  2. Open the api.json file put your api key and change your parameters. You can also set the parameters from the web interface.

    {
      "server_url": "https://api.heygen.com",
      "upload_url": "https://upload.heygen.com",
      "api_key": "<api_key>",
      "avatar": {
        "avatar_type": "<avatar_type>",
        "photar_id": "<photar_id>",
        "avatar_id": "<avatar_id>"
      },
      "voice": {
        "voice_id": "<voice_id>"
      },
      "silence_video_url": "<silence_video_url>"
    }
  3. Open a terminal in the project folder and install the necessary dependencies and start the server:

    npm install express
    node server.js

You will see the message App is listening on port 3000! indicating that the server is running.

Using the Demo

  1. Open your web browser and navigate to localhost:3000 to start the demo.
  2. (Optional) Select your talking photo image and click the "Upload" button to obtain the photar_id.
  3. (Optional) Click the "Generate Silent Video" button to get a silent video. The video will autoplay after generation is completed.
  4. Click the "Connect" button to create a new session. The status updates will be displayed on the screen.
  5. After the session is created successfully, type the text in the provided input field and click the "Talk" button to send a task to the avatar.
  6. Once you are done, click the "Close" button to terminate the session.

Remember, this is a demo and should be modified according to your needs and preferences. Happy coding!

Troubleshooting

In case you face any issues while running the demo or have any questions, feel free to raise an issue in this repository or contact our support team.

Please note, if you encounter a "Server Error", it could be due to the server being offline. In such cases, please contact the service provider.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.1%
  • CSS 9.0%
  • HTML 7.9%