Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Refactored audio and voice support #1882

Merged
merged 3 commits into from
Aug 9, 2016

Conversation

kaikreuzer
Copy link
Contributor

  • Created audio API in smarthome.core
  • Introduced smarthome.core.voice for TTS, STT and HLI APIs
  • Introduced smarthome.io.javasound for audio implementations based on Java Sound API
  • Introduced smarthome.voice.mactts as a Mac specific TTS implementation

Also-By: Harald Kuhn harald.kuhn@gmail.com
Also-By: Kelly Davis kdavis@mozilla.com
Also-By: Tilman Kamp tilmankamp@posteo.de
Signed-off-by: Kai Kreuzer kai@openhab.org

@kaikreuzer
Copy link
Contributor Author

kaikreuzer commented Jul 19, 2016

This PR contains all the work that was done for #584, #1081, #1028 and #1021.

I have tried to clean it all up, get the tests working, have stuff removed that is not possible to add to ESH due to the license (MaryTTS, PocketSphinx, etc.).

@hkuhn42 Would be great to have you reviewing this or at least that you familiarize yourself with it and see how/if you can further contribute to it (Kelly&Co unfortunately stopped working on it).

I shuffled around the interfaces a bit and decided to put the voice stuff now directly under core.voice and have the audio interfaces in the core bundle itself, so that issues like #1200 can be easily implemented without any optional dependencies.
The only other thing that is probably new to you is the AudioStream interface - I introduced this as a handle of a stream, while keeping AudioSource as an interface for OSGi services. When implementing services, I noticed that it makes much more sense this way.

@kaikreuzer
Copy link
Contributor Author

@maggu2810 FTR: This PR is more than 1000 lines and has contributions from others, so we will require a CQ for it. Once you and @hkuhn42 have given a lgtm, I will create a CQ for it.

@maggu2810
Copy link
Contributor

Travic CI failed:

[ERROR] Internal error: org.eclipse.tycho.core.osgitools.OsgiManifestParserException: Exception parsing OSGi MANIFEST /home/travis/build/eclipse/smarthome/bundles/core/org.eclipse.smarthome.core.voice/META-INF/MANIFEST.MF: Manifest file not found -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.core.osgitools.OsgiManifestParserException: Exception parsing OSGi MANIFEST /home/travis/build/eclipse/smarthome/bundles/core/org.eclipse.smarthome.core.voice/META-INF/MANIFEST.MF: Manifest file not found

@kaikreuzer
Copy link
Contributor Author

Weird, somehow all the new MANIFESTs are not shown (and added) in git...
Give me a moment.

@kaikreuzer
Copy link
Contributor Author

Not sure how the failing tests could potentially be related to this PR...?

@hkuhn42
Copy link
Contributor

hkuhn42 commented Jul 19, 2016

I will try to have a look into it tomorrow

*/
public class VoiceManager {

private static final Logger logger = LoggerFactory.getLogger(VoiceManager.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only one static method but that method does not use the logger. We could use a non-static logger

@kaikreuzer
Copy link
Contributor Author

thanks @maggu2810 I have updated the PR.

- Created audio API in smarthome.core
- Introduced smarthome.core.voice for TTS, STT and HLI APIs
- Introduced smarthome.io.javasound for audio implementations based on Java Sound API
- Introduced smarthome.voice.mactts as a Mac specific TTS implementation

Also-By: Harald Kuhn <harald.kuhn@gmail.com>
Also-By: Kelly Davis <kdavis@mozilla.com>
Also-By: Tilman Kamp <tilmankamp@posteo.de>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer
Copy link
Contributor Author

Tests are green now.
@hkuhn42 Any further comments from your end? If not, I would go ahead and create a CQ for it. We can still continue to work on the code after the merge, my main intention of this PR was to capture the code contributions from the others (before their CLAs mit not be valid anymore or what else could potentially happen).

@hkuhn42
Copy link
Contributor

hkuhn42 commented Jul 25, 2016

@kaikreuzer no more immediate comments. Please create the cq. I will need a bit more time to have an in depth look as i have to setup a new development environment first.

@kaikreuzer
Copy link
Contributor Author

Thanks for the feedback, @hkuhn42. I have now created CQ 11705 and will wait for its approval.

@kaikreuzer kaikreuzer added the CQ label Jul 26, 2016
@kaikreuzer kaikreuzer removed the CQ label Aug 9, 2016
@kaikreuzer
Copy link
Contributor Author

CQ is approved, hence I merge this now.

@kaikreuzer kaikreuzer merged commit 6be3a45 into eclipse-archived:master Aug 9, 2016
@kaikreuzer kaikreuzer deleted the voice branch August 9, 2016 19:40
@tavalin
Copy link
Contributor

tavalin commented Aug 19, 2016

@kaikreuzer any hints on where to start using the HLI interfaces? I found what looks to be the reference implementation (StandardInterpreter) but could not use it in my test bundle as it's not an Export-Package. Then I tried to create my own class that implements HumanLanguageInterpreter but despite adding the Import-Package I received the following:

Missing constraint: Import-Package: org.eclipse.smarthome.core.voice.text;version="0.0.0"

@kaikreuzer
Copy link
Contributor Author

Well, here the package is exported, so it should be available to you. In case you are using the openHAB 2 IDE, please note that I just release an ESH build that includes this PR tonight, so before it wasn't part of the target platform of openHAB.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants