I am trying to create a workflow that connects to Amazon Polly API. Is this possible? I am a total noob when it comes to buildship. If you have any tips or ideas i am totaly focused on your returns.
Now, i am here:
import { PollyClient, SynthesizeSpeechCommand } from "@aws-sdk/client-polly";
const command = new SynthesizeSpeechCommand(input); try { const { AudioStream, ContentType } = await client.send(command); if (AudioStream && ContentType === 'audio/mpeg') { let audioBuffer = []; for await (let chunk of AudioStream) { audioBuffer.push(chunk); } return Buffer.concat(audioBuffer).toString('base64'); } throw new Error('AudioStream is empty or ContentType is not MP3'); } catch (error) { throw new Error(