Discussions

Ask a Question

Streaming Avatar - data: { code: 10013, message: 'avatar not allow' }

I am trying to configure the avatar streaming API in real time using nodejs as the back interface, the same after many trial and error now it reflects avatar not allowed const axios = require('axios'); const { apiavatar } = require('../config/server'); require('dotenv').config(); const statusElement = \[] let sessionInfo = null; let peerConnection = null; function updateStatus(statusElement, message) { statusElement.innerHTML += message + '<br>'; statusElement.scrollTop = statusElement.scrollHeight; } updateStatus(statusElement, 'Please click the new button to create the stream first.'); function onMessage(event) { const message = event.data; console.log('Received message:', message); } // Create a new WebRTC session when clicking the "New" button async function createNewSession() { updateStatus(statusElement, 'Creating new session... please wait'); ``` const avatar = avatarName.value; const voice = voiceID.value; // call the new interface to get the server's offer SDP and ICE server to create a new RTCPeerConnection sessionInfo = await newSession('high', avatar, voice); const { sdp: serverSdp, ice_servers2: iceServers } = sessionInfo; // Create a new RTCPeerConnection peerConnection = new RTCPeerConnection({ iceServers: iceServers }); // When ICE candidate is available, send to the server peerConnection.onicecandidate = ({ candidate }) => { console.log('Received ICE candidate:', candidate); if (candidate) { handleICE(sessionInfo.session_id, candidate.toJSON()); } }; // When ICE connection state changes, display the new state peerConnection.oniceconnectionstatechange = (event) => { updateStatus( statusElement, `ICE connection state changed to: ${peerConnection.iceConnectionState}`, ); }; // When audio and video streams are received, display them in the video element peerConnection.ontrack = (event) => { console.log('Received the track'); if (event.track.kind === 'audio' || event.track.kind === 'video') { mediaElement.srcObject = event.streams[0]; } }; // When receiving a message, display it in the status element peerConnection.ondatachannel = (event) => { const dataChannel = event.channel; dataChannel.onmessage = onMessage; }; // Set server's SDP as remote description const remoteDescription = new RTCSessionDescription(serverSdp); await peerConnection.setRemoteDescription(remoteDescription); updateStatus(statusElement, 'Session creation completed'); updateStatus(statusElement, 'Now.You can click the start button to start the stream'); ``` } // Start session and display audio and video when clicking the "Start" button async function startAndDisplaySession() { if (!sessionInfo) { updateStatus(statusElement, 'Please create a connection first'); return; } ``` updateStatus(statusElement, 'Starting session... please wait'); // Create and set local SDP description const localDescription = await peerConnection.createAnswer(); await peerConnection.setLocalDescription(localDescription); // Start session await startSession(sessionInfo.session_id, localDescription); updateStatus(statusElement, 'Session started successfully'); ``` } module.exports = async (req, res) => { // try { // Configurar la solicitud para iniciar una nueva transmisión const newStreamOptions = { method: 'POST', url: `${apiavatar}/v1/streaming.new`, headers: { accept: 'application/json', 'x-api-key': process.env.apikey }, data: { quality: process.env.quality, avatar_name: process.env.avatar_Name, voice: { voice_id:process.env.avatar_Voice, }, } }; // Enviar la solicitud para iniciar una nueva transmisión const responseNew = await axios(newStreamOptions); ```Text nodejs // Extraer session_id y sdp de la respuesta de la nueva transmisión const dataStream = responseNew.data.data; const session_id = dataStream.session_id; const sdp = { type: dataStream.sdp.type, sdp: dataStream.sdp.sdp }; const response = await fetch(`${apiavatar}/v1/streaming.start`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Api-Key': process.env.apikey, }, body: JSON.stringify({ session_id, sdp }), }); if (response.status === 500) { console.error('Server error'); updateStatus( statusElement, 'Server Error. Please ask the staff if the service has been turned on', ); throw new Error('Server error'); } else { const data = await response.json(); res.status(200).send(data); } } ``` If I load the scripts directly for its operation it gives me an error with the front implementation that I am using nextjs

Browser support

Our digital human test on Safari does not show. Do we support macbook's Safari browser or ios's browser device?

Real Time Avatar API: is it possible to stream in H264 instead of webm/VP8?

Hey Team HeyGen, I would like to incorporate your magical realtime avatar livestream into an iOS app. Unfortunately apple doesn't support the VP8 codec. Is there a possibility to change the stream to a H264 codec? Would be amazing if that was a possibility! Many thanks!! Robin

Building Talking Avatar demo on Next.js - Getting error 400 bad request on StartSession Function

Hello, I'm trying to run the example on a version of Next.js. I'm able to obtain the required information in exactly the following order (based on the example and documentation): I upload the image and receive the ID of the new image (I successfully receive the response or "talk_photo"). I open the session with "NewSession" and pass it the parameters of the image and quality (I successfully receive the response). I then pass the session response (the first two operations are executed on the server-side) to the client. From there, as the next step, I create the RTCPeerConnection and pass the ice_servers (this step is successful). I then create the descriptions, both remote and local first because I need them to generate the onicecandidate (they are also generated successfully). Once I have the descriptions, I call the StartSession function (because according to the documentation, I need to invoke it before calling "realtime ice"). When debugging in the browser, I see that I successfully pass the parameters session_id and sdp. However, this step (Start Session) fails. I get a 400 Bad Request response. I reproduced the same steps in Insomnia with the parameters, and at this point, I always get a Bad Request with "Invalid request json body." Regarding the ice, I also noticed that I successfully pass the candidates and the sessionID, but it never generates the video because, according to the documentation, I need the response from the StartSession function. Could someone provide an idea of what might be happening? I also can provide the Id(If need it which does not belows to this account), more info about the code can be found also on <https://stackoverflow.com/questions/77781071/heygen-talking-avatar-demo-migration-to-next-js-getting-400-bad-request-on-sta>

Method to differentiate streaming videos.

I'm currently trying to stream three sentences with a 1 to 1.5-second interval using the `talk text` function. For instance, when I call it in the order of "A," "B," "C," I want to differentiate the streaming videos for "A," "B," and "C." In the demo code, it distinguishes them using `report.bytesReceived`, but this method isn't clear for precise differentiation. If you have a better approach, I would appreciate it if you could share it with me. (This is intended to display subtitles corresponding to each video.)

"Voice has expired" at line 1

I can not create any video because always heygen discloses the same message: "Voice has expired" at line 1 Marcelo Dantas Tavares de Melo [Avatar Finetune + Pro Voice] [[email protected]](mailto:[email protected])

"Voice is expired" at line 1 error message

Hi, Trying to use HeyGen to create a new video based on a finetuned avatar I created (I have a creator subscription and paid for the finetuned avatar) but get an error message when I try to create a video from it: "Voice is expired" at line 1 Any idea of why I get such message? Thanks, G.

Why does this payload work and this doesn't?

Hi, I'm calling the endpoint: <https://api.heygen.com/v1/video.generate> And here are three payloads: - A: Doesn't work - Text is 1195 caracter - B: Doesn't work - Text is 1196 caracter (one o at the end) - C: Works - Text is 1197 caracter (two o at the end) The ones not working return: Call API: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>400 Bad Request</title> <h1>Bad Request</h1> <p>The browser (or proxy) sent a request that this server could not understand.</p> PAYLOAD A: { "template_id": "4656a89cf6444ab2a93216d1116f2508", "title": "property investment, residential property portfolio, comprehensive due diligence", "variables": [ { "properties": { "id": "8f216b3f242d4f11b4474a98e8f02fae", "voice_id": "a3c629a7986e4f14a197101e78b36abf", "text": "Hi my name is jamie from siteline properties At siteline we use our .. proprietary technology, to help passionate investors like yourself easily build, manage and scale residential property portfolios. We take care of everything – from sourcing the properties, to letting them! This means you can divert your attention elsewhere whilst we do all the work! How does that sound? Here's how it works... Tell us your budget .. preferred locations .. and yield expectations. Using our innovative technology, we’ll instantly source a fully vetted list of profitable investment opportunities that match your search criteria. We’ll package this up into an.. easy-to-understand document ready for you to approve. All properties go through our own comprehensive due diligence process. Our team of experts will collate and share all of the financial break-down, comparable properties in the market, local area information, refurbishment requirements (if any) and estate agent valuations for sales and lettings. We’ll take care of the entire process from sourcing the deals through to letting them. From sourcing and due diligence, to full deal management and beyond – we’ll take care of everything." }, "name": "avatar_0" } ], "test": false, "caption_open": true } PAYLOAD B: { "template_id": "4656a89cf6444ab2a93216d1116f2508", "title": "property investment, residential property portfolio, comprehensive due diligence", "variables": [ { "properties": { "id": "8f216b3f242d4f11b4474a98e8f02fae", "voice_id": "a3c629a7986e4f14a197101e78b36abf", "text": "Hi my name is jamie from siteline properties At siteline we use our .. proprietary technology, to help passionate investors like yourself easily build, manage and scale residential property portfolios. We take care of everything – from sourcing the properties, to letting them! This means you can divert your attention elsewhere whilst we do all the work! How does that sound? Here's how it works... Tell us your budget .. preferred locations .. and yield expectations. Using our innovative technology, we’ll instantly source a fully vetted list of profitable investment opportunities that match your search criteria. We’ll package this up into an.. easy-to-understand document ready for you to approve. All properties go through our own comprehensive due diligence process. Our team of experts will collate and share all of the financial break-down, comparable properties in the market, local area information, refurbishment requirements (if any) and estate agent valuations for sales and lettings. We’ll take care of the entire process from sourcing the deals through to letting them. From sourcing and due diligence, to full deal management and beyond – we’ll take care of everything.o" }, "name": "avatar_0" } ], "test": false, "caption_open": true } PAYLOAD C: { "template_id": "4656a89cf6444ab2a93216d1116f2508", "title": "property investment, residential property portfolio, comprehensive due diligence", "variables": [ { "properties": { "id": "8f216b3f242d4f11b4474a98e8f02fae", "voice_id": "a3c629a7986e4f14a197101e78b36abf", "text": "Hi my name is jamie from siteline properties At siteline we use our .. proprietary technology, to help passionate investors like yourself easily build, manage and scale residential property portfolios. We take care of everything – from sourcing the properties, to letting them! This means you can divert your attention elsewhere whilst we do all the work! How does that sound? Here's how it works... Tell us your budget .. preferred locations .. and yield expectations. Using our innovative technology, we’ll instantly source a fully vetted list of profitable investment opportunities that match your search criteria. We’ll package this up into an.. easy-to-understand document ready for you to approve. All properties go through our own comprehensive due diligence process. Our team of experts will collate and share all of the financial break-down, comparable properties in the market, local area information, refurbishment requirements (if any) and estate agent valuations for sales and lettings. We’ll take care of the entire process from sourcing the deals through to letting them. From sourcing and due diligence, to full deal management and beyond – we’ll take care of everything.oo" }, "name": "avatar_0" } ], "test": false, "caption_open": true }

Why is the sample request blocked, click on the page try it can?

![](https://files.readme.io/c5f7f55-image.png) ![](https://files.readme.io/5847f00-image.png) ![](https://files.readme.io/e014b65-image.png) Why is the sample request blocked, click on the page try it can? What is the reason please

Scene Limit for V2 API endpoint

Why there is a scene limit of 10 per video for the api endpoint - <https://api.heygen.com/v2/video/generate>, when there is no scene limit when we are creating the video through web application. Does the v1 api endpoint - <https://api.heygen.com/v1/video.generate> also has a scene limit?