1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "text": "Welcome to our channel! Today we are going to talk about the history of coffee. Long before it reached cafes around the world, coffee grew wild in the highlands of Ethiopia. Traders carried the beans across the Red Sea to Yemen, where people began roasting and brewing them. From there, coffee houses spread to Cairo, Istanbul and finally to Europe.",
12 "voiceId": "auq43ws1oslv0tO4BDa7"
13};
14
15
16const run = await client.actor("speakvela/elevenlabs-text-to-speech").call(input);
17
18
19console.log('Results from dataset');
20console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
21const { items } = await client.dataset(run.defaultDatasetId).listItems();
22items.forEach((item) => {
23 console.dir(item);
24});
25
26