Skip to content

Conversation

@mahovich
Copy link

@mahovich mahovich commented Dec 3, 2025

In some cases, this will reduce the number of chunks, and for isomorphic-utils, it will reduce the number of operations.

For example, a text 4097 characters long with whitespace characters at the beginning or end of the text will fit into 1 chunk, not 2 as it does now:

import { EdgeTTS } from 'edge-tts-universal';
import fs from 'fs/promises';

const text__ = '          ' + 'Lorem Ipsum. '.repeat(315); // 10 + 4095 characters

const tts = new EdgeTTS(text);
const result = await tts.synthesize();
const audioBuffer = Buffer.from(await result.audio.arrayBuffer());
await fs.writeFile('output.mp3', audioBuffer);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant