[APP][Pro] FTP Client - Control FTP Servers through a directory-based UI in the Homey App or Web App

Use the HomeyScript return a Text flowcard.
Than fill this script.
The tag it will generate will have the MP3 file in base64.
That you can save to the FTP with the save base64 as file flowcard.

let call = await fetch("https://api.elevenlabs.io/v1/text-to-speech/XrExE9yKIg1WjnnlVkGX?enable_logging=true&output_format=mp3_44100_96", {
  method: "POST",
  body: JSON.stringify(
    {"text":"Dit is een test file","model_id":"eleven_multilingual_v2","voice_settings":{"stability":0.5,"similarity_boost":0.75,"style":0,"use_speaker_boost":true}}
  ),
  headers: {
    "Content-type": "application/json; charset=UTF-8",
    "xi-api-key":"FILL YOUR KEY"
  }
});

let mp3 = await call.buffer();

let base64 = Buffer.from(mp3).toString('base64');
return base64;
2 Likes