Discussions

Ask a Question
Back to All

API Integration Issue - Invalid Audio Format

Hello,

I'm working on integrating the Heygen API (v2) to generate a video with a talking avatar overlaid on a background video. Here's what I'm trying to achieve:

  1. I download a video to use as background
  2. I generate an MP3 audio file containing the voice
  3. I send a request to the Heygen API with the following configuration:
    • An avatar (nik_expressive_20240910)
    • An MP3 audio file hosted on Supabase Storage
    • A background video

Here's my request structure:

{
  "video_inputs": [
    {
      "character": {
        "type": "avatar",
        "avatar_id": "nik_expressive_20240910",
        "style": "normal",
        "scale": 1.6,
        "position": {
          "x": -0.1,
          "y": 0.2
        }
      },
      "voice": {
        "type": "audio",
        "audio_url": "https://isoidmeiymclqughfkaz.supabase.co/storage/v1/object/public/audio/4031e5d5-432b-421d-870b-1817952c7cbd.mp3"
      },
      "background": {
        "type": "video",
        "url": "https://isoidmeiymclqughfkaz.supabase.co/storage/v1/object/public/videos/downloaded/4031e5d5-432b-421d-870b-1817952c7cbd.mp4",
        "play_style": "once"
      }
    }
  ],
  "dimension": {
    "width": 720,
    "height": 1280
  }
} 

I'm receiving this error:

{  
  "code": 100,  
  "data": {  
    "error": {  
      "code": 40044,  
      "detail": "Failed to open audio file: <https://isoidmeiymclqughfkaz.supabase.co/storage/v1/object/public/audio/4031e5d5-432b-421d-870b-1817952c7cbd.mp3">,  
      "message": "Invalid audio format"  
    },  
    "status": "failed"  
  },  
  "message": "Success"  
}

Questions:

What audio formats are supported by the API?
Are there specific requirements for MP3 encoding?
Do you have any recommendations on how to generate the audio file to ensure compatibility?


Thank you for your help!