Text limit constraint and other thoughts
KevinSJ opened this issue · comments
Hello Danesprite
I really like this app and thanks for creating it and make it open source!
I had personally tried to creat a similar (toy) app that does similar stuff. Instead of using the share action. I opted to use the text action (my use case is use the app to read long articles), so I can select all text (in reader mode in firefox) and then click on the read to have the article read to me.
Due to nature of most of the articles, I found the built-in text limit for android tts too low for most of them, therefore I used a splitter to split long text (by new line) to work around that limit.
Just wondering, would you accept pull request that
- work around the text to speech limit like I described above?
- add a text action that is similar to sharing but one less click? 😄
Hello Danesprite,
Will create a PR for text action soon.
Regarding the limit on length, after going through the code, I did realize that you had done it. Sorry for the misunderstanding.
I encountered several cases where the app stop speaking during a long Chinese article which is why I initially thought the functionality is not implemented. Based on my understanding, tts-util converts text to byte array and the spliting is done afterwards, which might be the cause as Chinese characters takes 3 bytes (and my toy app which just naively spliting long string seems to work fine). Will play around more and see if I can find anything.
Hello Danesprite,
Will create a PR for text action soon.
Regarding the limit on length, after going through the code, I did realize that you had done it. Sorry for the misunderstanding.
I encountered several cases where the app stop speaking during a long Chinese article which is why I initially thought the functionality is not implemented. Based on my understanding, tts-util converts text to byte array and the spliting is done afterwards, which might be the cause as Chinese characters takes 3 bytes (and my toy app which just naively spliting long string seems to work fine). Will play around more and see if I can find anything.
actually it looks like this is an issue I caused, I had changed the code to add text action and reading long article from there seem to be the cause of this issue.
Hello Dane,
The PR I created actually have some issues, I used Theme.NoDisplay as theme, trying to hide the interface, this seems to cause the app to force close in some situations. I had switched to use another theme, but will need some time to test it. Will push the update later.
Regarding the long text input issue, it seems to be a bit inconsistent, it was able to speak for 30 minutes continuously without issue yesterday. Now I suspect it might have something to do with battery optimization on my phone.
Hello Dane,
I have pushed a fix that reverted to use the AppCompact theme for now.