Skip to content

Commit

Permalink
chore: uncomment failing test to validate new Fern generator
Browse files Browse the repository at this point in the history
  • Loading branch information
louisjoecodes committed Dec 13, 2024
1 parent 3cf4051 commit b67dec0
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions tests/custom/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,23 @@ describe("ElevenLabs API Tests", () => {
expect(result.alignment).toBeDefined();
await playIfNotGithub(Buffer.from(result.audio_base64, "base64"));
});
// !!! streamWithTimestamps isn't returning anything - uncomment this once Fern fixes issue upstream

// it("streamWithTimestamps", async () => {
// const client = new ElevenLabsClient();
// let audioData = Buffer.alloc(0);

// const stream = await client.textToSpeech.streamWithTimestamps(DEFAULT_VOICE, {
// text: DEFAULT_TEXT,
// model_id: DEFAULT_MODEL,
// });
// for await (const chunk of stream) {
// if ("audio_base64" in chunk) {
// const audioChunk = Buffer.from(chunk.audio_base64, "base64");
// audioData = Buffer.concat([audioData, audioChunk]);
// }
// }
// expect(audioData.length).toBeGreaterThan(0);
// await playIfNotGithub(audioData);
// });
it("streamWithTimestamps", async () => {
const client = new ElevenLabsClient();
let audioData = Buffer.alloc(0);

const stream = await client.textToSpeech.streamWithTimestamps(DEFAULT_VOICE, {
text: DEFAULT_TEXT,
model_id: DEFAULT_MODEL,
});
for await (const chunk of stream) {
if ("audio_base64" in chunk) {
const audioChunk = Buffer.from(chunk.audio_base64, "base64");
audioData = Buffer.concat([audioData, audioChunk]);
}
}
expect(audioData.length).toBeGreaterThan(0);
await playIfNotGithub(audioData);
});
});

describe("audioIsolation", () => {
Expand Down

0 comments on commit b67dec0

Please sign in to comment.