Discussions

Ask a Question
ANSWERED

how to use api in kotlin

can any tell me this
ANSWERED

Error identity verification video

I am encountering the following error during the submission of the identity verification video: **root** is invalid: consent_text_validation_id is required if reuse_consent is False. How can I resolve it?
ANSWERED

Canva Presentation

Hi there - I made an instant avatar and it looks and sounds gret - but when I go to use it in Canva to narrate a presentation it only lets me use one of their voices. How can I use my own voice? It seems silly to have me talking and someone else's voice coming out of my mouth

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
ANSWERED

Avatar is missing in the API

We were using `Vlada-pro-insuit-20221215`, which now seems to be missing in the API? It is also not showing up in the voices endpoint. Is she not available anymore?
ANSWERED

Realtime - New Session return 400

I am trying call reqeust curl --request POST --url <https://api.heygen.com/v2/realtime/new> --header 'accept: application/json' --header 'content-type: application/json' --header 'x-api-key: ' --data ' { "avatar": { "avatar_type": "photar", "photar_id": "05" }, "voice": { "voice_id": "8cd" }, "dimension": { "width": 640, "height": 450 } } And returning the error { "error": { "code": "invalid_parameter", "message": "Key: 'NewSessionRequest.SpaceId' Error:Field validation for 'SpaceId' failed on the 'required' tag\\nKey: 'NewSessionRequest.Quality' Error:Field validation for 'Quality' failed on the 'required' tag" } } Where do I set these parameters?
ANSWERED

Whitelist User

After applying to become a whitelist user how do I get notified?
ANSWERED

Streaming API Availability

Hello, We have conducted tests with both versions 1 and 2 of the streaming API and understand that it is currently in the beta phase. Could you please confirm if the beta status applies to both versions (v1 and v2)? Additionally, we would like to know if the limitation of having only one connection at a time is applicable to all versions of the streaming API. Thank you!
ANSWERED

Real-time Avatar API

What's subscription should I buy to get the real-time avatar API or Streaming Avatars and what is the longest minutes can I use it ?
ANSWERED

Error with code 40102 when calling the endpoint "<https://api.heygen.com/v1/video.generate"> using the trial API key.

Hello. First of all, greetings. I have a problem: When I call the mentioned endpoint with my trial API key, I get the message: "Unauthorized" and the error code: 40102. I have the free plan. Do I have to purchase the enterprise plan to use the trial API key? Or what could be happening? I really appreciate your time. Email: [[email protected]](mailto:[email protected])