Skip to content
New issue

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

deno TTS aws s3 example is broken #57

Open
khcd opened this issue Oct 18, 2024 · 1 comment
Open

deno TTS aws s3 example is broken #57

khcd opened this issue Oct 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@khcd
Copy link

khcd commented Oct 18, 2024

examples/text-to-speech/deno/text-to-speech/text-to-speech-aws.ts

Screenshot 2024-10-18 at 11 00 30 am

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.

@louisjoecodes
Copy link
Collaborator

Hey folks - thanks a lot - I am doing a big push on the guides. Will do a clean-up and fix this very soon.

@louisjoecodes louisjoecodes added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants