We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/text-to-speech/deno/text-to-speech/text-to-speech-aws.ts
current code results in data loss you can see via the files only sized in bytes
modified code to prevent data loss:
replace: const content = new Uint8Array(chunks.flat()); with: ` const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0); const content = new Uint8Array(totalLength);
const content = new Uint8Array(chunks.flat());
let offset = 0; for (const chunk of chunks) { content.set(chunk, offset); offset += chunk.length; } `
above code is LLM suggested but I have functionally tested it.
Can submit PR if allowed.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
examples/text-to-speech/deno/text-to-speech/text-to-speech-aws.ts
current code results in data loss you can see via the files only sized in bytes
modified code to prevent data loss:
replace:
const content = new Uint8Array(chunks.flat());
with:
`
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
const content = new Uint8Array(totalLength);
let offset = 0;
for (const chunk of chunks) {
content.set(chunk, offset);
offset += chunk.length;
}
`
above code is LLM suggested but I have functionally tested it.
Can submit PR if allowed.
The text was updated successfully, but these errors were encountered: