elevenlabs / elevenlabs-js

The official JavaScript (Node) library for ElevenLabs Text to Speech.
https://elevenlabs.io
MIT License
60 stars 7 forks source link

Dubbing: Receiving target language empty even though sending a target language #54

Open asafchn opened 2 weeks ago

asafchn commented 2 weeks ago

Issue Using the dubbing api i'm receiving a 400 error that my request is missing the target_lang even though it is provided

Expected pretty straightforward, the targetlanguage should work

Example code

const response = await elevenlabs.dubbing.dubAVideoOrAnAudioFile({
      mode: "automatic",
      source_lang: "en",
      target_lang: "de",
      file: video,
    });

and the response:

image
dsinghvi commented 2 weeks ago

@asafchn do you mind trying the request via cURL and confirming that the API doesn't throw? We would love to narrow whether or not the error is specific to the SDK

brainvine commented 1 week ago

Same issue here:

Console log:

{
  source_url: 'https://www.youtube.com/watch?v=FAyKDaXEAgc',
  source_lang: 'en',
  target_lang: 'nl',
  mode: 'automatic'
}

Error during dubbing request: {
  detail: {
    status: 'empty_target_language',
    message: 'Target language must be set in automatic dubbing mode. Either set the target language or set dubbing studio to true.'
  }
}
 POST /api/tools/video-dubbing 500 in 220ms

Not using the SDK, but direct API call in NextJS. This only happens on "URL" mode, not on the file-upload:

} else if (url) {
            const data = {
                source_url: url,
                source_lang: sourceLanguage,
                target_lang: targetLanguage,
                mode: "automatic"
            };
            console.log(data);

            response = await axios.post("https://api.elevenlabs.io/v1/dubbing", data, {
                headers: {
                    "xi-api-key": apiKey,
                    "Content-Type": "application/json"
                }
            });
dsinghvi commented 4 days ago

@lharries it looks like the user is saying that this doesn't work in the raw API