-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[mimictts] Add LRU cache #14564
[mimictts] Add LRU cache #14564
Conversation
Maybe your class AutoDeleteFileAudioStream could be moved into core framework to be used by different add-ons? |
Hum yes, but is it really a good implementation for core ? The more I think about it, the more I think it should be handled in the And then, in the
Then we won't have to do workarounds in all TTS services for the audio sinks that only support this multi time WDYT ? |
Looks like a great idea. |
@dalgwen : do you propose to implement your idea ( |
@dalgwen : I have another idea.
Our problem is only with the second case. Why not distinguishing the two cases and add a new method WDYT ? Edit: In fact, we just need to know in |
Related to openhab/openhab-addons#14564 (comment) Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Related to openhab/openhab-addons#14564 (comment) Signed-off-by: Laurent Garnier <lg.hc@free.fr>
I made a try : With this, the servlet and the audiosinks using it do not need to restrain to FixedLengthAudioStream. Of course, if it not needed (if the TTS service or the cache already made a file), there is no modification. I still have one weird behaviour : the code to delete the file when expired is called, but the file remains on disk. |
Looks like a good solution? I hope you can fix your weird behaviour with file not deleted. |
I did a PR for what we discuss here. In the meantime, I put this PR on "draft" mode |
89db2b8
to
33b4fb6
Compare
33b4fb6
to
6c13d97
Compare
@dalgwen : is it ready for a review ? |
And simplifies code with new core capabilities (no more need to create temporary files implementing FixedLengthAudioStream) Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
6c13d97
to
3b792b9
Compare
I just force pushed after a rebase. As this PR removes the workaround for the HTTP audio servlet, it will break compatibility with audio sink using audio servlet and still testing against FixedLengthAudioStream. |
bundles/org.openhab.voice.mimictts/src/main/resources/OH-INF/config/config.xml
Show resolved
Hide resolved
Please unmark the PR as draft in this case. |
...g.openhab.voice.mimictts/src/main/java/org/openhab/voice/mimic/internal/MimicTTSService.java
Show resolved
Hide resolved
Apply code review and static analysis. Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
...g.openhab.voice.mimictts/src/main/java/org/openhab/voice/mimic/internal/MimicTTSService.java
Show resolved
Hide resolved
...g.openhab.voice.mimictts/src/main/java/org/openhab/voice/mimic/internal/MimicTTSService.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you
I will wait a little (maybe end of weekend), I hope someone will merge my changes in audio sinks. |
* [mimictts] Add LRU cache And simplifies code with new core capabilities (no more need to create temporary files implementing FixedLengthAudioStream) --------- Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Hello,
This pull request add the common TTS cache capability to the mimic TTS Service. (MimicTTSService.java)
And also : [mimictts] Fix playing with audio servlet
It also fixes an issue with a sound not playing with servlet based sink. (AutoDeleteFileAudioStream.java)
(The system responsible for deleting a file that is not used anymore was too greedy. The sound file was deleted, detecting a closing stream, before even being read for "real")