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

audio.connecttospeech() function not working on long sentences #630

Open
DuyenCdt opened this issue Dec 20, 2023 · 8 comments
Open

audio.connecttospeech() function not working on long sentences #630

DuyenCdt opened this issue Dec 20, 2023 · 8 comments

Comments

@DuyenCdt
Copy link

I get a memory error message when using a long sentence in the audio.connecttospeech() function, is there any way to save that sentence to SD memory instead of Esp32 memory, or is there another way to save it to free memory on Esp32?
Thank you
image

@spikepavel
Copy link

Even if you have a lot more memory, the long message won't work. This is some kind of error and apparently an additional check for buffer overflow is needed. This is observed in many people. I split the text into lines and send it in batches, otherwise an error reboot occurs.

@schreibfaul1
Copy link
Owner

Google limits the length of the string. I don't know of any equivalent free alternative.

@aber68
Copy link

aber68 commented Dec 17, 2024

hello, how this "batch" may look alike? sending sentences one after the other will only play the last one ... br andreas

@spikepavel
Copy link

Hello. If I understood you correctly, then you need to pause equal to the playback time of the last send. I did it so that I counted the number of letters and made a final delay for each letter before sending the next sentence.

@schreibfaul1
Copy link
Owner

Google TTS is free, but the length is severely limited. So you would have to wait for the audio_eof_stream(const char* info) event to send the next string. A simple way to do this would be to build a string queue, for example with a <char*>vector.

@aber68
Copy link

aber68 commented Dec 18, 2024

i tried several attempts with audio_eof_stream, but it always brings the last chunked sentence. i have no idea how to put out a length >100. do you have a code example which will do the job even with truncated chunks of phrases?

@spikepavel
Copy link

No way. Break it down into several words. Wait for the end of playback and submit a new batch of words to the input. It uses the free version of Google TTS. If you want large packages (25 thousand characters), then only for money.

@aber68
Copy link

aber68 commented Dec 18, 2024

what is the length limit of Google TTS free? i estimate around 100 ...

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

No branches or pull requests

4 participants