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

Debounce inputs in case of incremental manual input #9

Open
royshil opened this issue Jul 16, 2024 · 4 comments
Open

Debounce inputs in case of incremental manual input #9

royshil opened this issue Jul 16, 2024 · 4 comments

Comments

@royshil
Copy link
Contributor

royshil commented Jul 16, 2024

When manually typing it would periodically start TTS
Better if it would wait for a pause and only then set off

@darkvaderzerotwo
Copy link

darkvaderzerotwo commented Jul 16, 2024

Rather than just a debounce, i'd have a minimum delay between changes that it reads the screen out; For Example (and specific to what i've been trying to do) a visual novel often has the text scroll in so for it to wait for that would be useful.
In my example I'm using the OBS OCR plug-in to get the text from a visual novel which then goes into a text element.
Squawk then reads that text element.
Often what happens is that Squawk will start trying to read out the Text, before the OCR has actually finished, so you'll end up with a medium length sentence like "I don't know... It's not something i've thought about before" taking a second or two to read in, so squawk will start reading something like "I don't know... it's no"... "I don't know... it's not something i'" "I don't know... it's not something i've thought abou" etc etc etc.
It would be useful for squawk to wait for a steady state and have a steady state time (say half a second) before it starts attempting to voice the text. I've been trying to work around it by setting a delay in the OCR and while it's helped, sometimes it'll start reading only half a sentence.
If you'd like me to upload an example video I can do.

@royshil
Copy link
Contributor Author

royshil commented Jul 22, 2024

@darkvaderzerotwo can you check the latest version v0.0.4? i added the functionality to handle this case

@darkvaderzerotwo
Copy link

@darkvaderzerotwo can you check the latest version v0.0.4? i added the functionality to handle this case

I've just given it a go, it seems a fair bit better! there is a fair delay before it starts reading of about 4 seconds but it's much more consistent on when it decides to start reading and I am not needing a delay (other than 300ms) in the OCR.
Now the flipside... the opposite problem is occuring. What I believe is happening is that the OCR keeps refreshing the file/changing a character in the input stream (say a comma to a full-stop and back or some whitespace) and squawk then doesn't attempt to start reading out the line of text because even if it visually looks 99.9% close to what it's supposed to be, the text field is changing enough the debounce is constantly stuck waiting.
here's an example:
https://github.com/user-attachments/assets/d9ca8815-d473-4248-a3df-a7dabea8e4da
Great work so far.

@royshil
Copy link
Contributor Author

royshil commented Jul 22, 2024

huh. it seems squawk would miss the whole input sometimes... i need to investigate this more

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

2 participants