This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 782
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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>
- Loading branch information
1 parent
3a7999e
commit 0204136
Showing
114 changed files
with
5,894 additions
and
142 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
bundles/core/org.eclipse.smarthome.core.voice.test/.classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src/test/java"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.smarthome.core.voice"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
33 changes: 33 additions & 0 deletions
33
bundles/core/org.eclipse.smarthome.core.voice.test/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.smarthome.core.voice.test</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ds.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
bundles/core/org.eclipse.smarthome.core.voice.test/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source.. = src/test/java/ | ||
output.. = target/test-classes/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
about.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...home.core.voice.test/src/test/java/org/eclipse/smarthome/core/voice/STTExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) 2014-2016 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.core.voice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test general purpose STT exception | ||
* | ||
* @author Kelly Davis - Initial contribution and API | ||
*/ | ||
public class STTExceptionTest { | ||
|
||
/** | ||
* Test STTException() constructor | ||
*/ | ||
@Test | ||
public void testConstructor0() { | ||
STTException ttsException = new STTException(); | ||
Assert.assertNotNull("STTException() constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test STTException(String message, Throwable cause) constructor | ||
*/ | ||
@Test | ||
public void testConstructor1() { | ||
STTException ttsException = new STTException("Message", new Throwable()); | ||
Assert.assertNotNull("STTException(String, Throwable) constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test STTException(String message) constructor | ||
*/ | ||
@Test | ||
public void testConstructor2() { | ||
STTException ttsException = new STTException("Message"); | ||
Assert.assertNotNull("STTException(String) constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test STTException(Throwable cause) constructor | ||
*/ | ||
@Test | ||
public void testConstructor3() { | ||
STTException ttsException = new STTException(new Throwable()); | ||
Assert.assertNotNull("STTException(Throwable) constructor failed", ttsException); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
....test/src/test/java/org/eclipse/smarthome/core/voice/SpeechRecognitionErrorEventTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright (c) 2014-2016 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.core.voice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test SpeechRecognitionErrorEvent event | ||
* | ||
* @author Kelly Davis - Initial contribution and API | ||
*/ | ||
public class SpeechRecognitionErrorEventTest { | ||
|
||
/** | ||
* Test SpeechRecognitionErrorEvent(String) constructor | ||
*/ | ||
@Test | ||
public void testConstructor() { | ||
SpeechRecognitionErrorEvent sRE = new SpeechRecognitionErrorEvent("Message"); | ||
Assert.assertNotNull("SpeechRecognitionErrorEvent(String) constructor failed", sRE); | ||
} | ||
|
||
/** | ||
* Test SpeechRecognitionErrorEvent.getMessage() method | ||
*/ | ||
@Test | ||
public void getMessageTest() { | ||
SpeechRecognitionErrorEvent sRE = new SpeechRecognitionErrorEvent("Message"); | ||
Assert.assertEquals("SpeechRecognitionErrorEvent.getMessage() method failed", "Message", sRE.getMessage()); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...voice.test/src/test/java/org/eclipse/smarthome/core/voice/SpeechRecognitionEventTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) 2014-2016 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.core.voice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test SpeechRecognitionEvent event | ||
* | ||
* @author Kelly Davis - Initial contribution and API | ||
*/ | ||
public class SpeechRecognitionEventTest { | ||
|
||
/** | ||
* Test SpeechRecognitionEvent(String, float) constructor | ||
*/ | ||
@Test | ||
public void testConstructor() { | ||
SpeechRecognitionEvent sRE = new SpeechRecognitionEvent("Message", 0.5f); | ||
Assert.assertNotNull("SpeechRecognitionEvent(String, float) constructor failed", sRE); | ||
} | ||
|
||
/** | ||
* Test SpeechRecognitionEvent.getTranscript() method | ||
*/ | ||
@Test | ||
public void getTranscriptTest() { | ||
SpeechRecognitionEvent sRE = new SpeechRecognitionEvent("Message", 0.5f); | ||
Assert.assertEquals("SpeechRecognitionEvent.getTranscript() method failed", "Message", sRE.getTranscript()); | ||
} | ||
|
||
/** | ||
* Test SpeechRecognitionEvent.getConfidence() method | ||
*/ | ||
@Test | ||
public void getConfidenceTest() { | ||
SpeechRecognitionEvent sRE = new SpeechRecognitionEvent("Message", 0.5f); | ||
Assert.assertEquals("SpeechRecognitionEvent.getConfidence() method failed", (double) 0.5f, | ||
(double) sRE.getConfidence(), (double) 0.001f); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...home.core.voice.test/src/test/java/org/eclipse/smarthome/core/voice/TTSExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) 2014-2016 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.core.voice; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test general purpose TTS exception | ||
* | ||
* @author Kelly Davis - Initial contribution and API | ||
*/ | ||
public class TTSExceptionTest { | ||
|
||
/** | ||
* Test TTSException() constructor | ||
*/ | ||
@Test | ||
public void testConstructor0() { | ||
TTSException ttsException = new TTSException(); | ||
Assert.assertNotNull("TTSException() constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test TTSException(String message, Throwable cause) constructor | ||
*/ | ||
@Test | ||
public void testConstructor1() { | ||
TTSException ttsException = new TTSException("Message", new Throwable()); | ||
Assert.assertNotNull("TTSException(String, Throwable) constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test TTSException(String message) constructor | ||
*/ | ||
@Test | ||
public void testConstructor2() { | ||
TTSException ttsException = new TTSException("Message"); | ||
Assert.assertNotNull("TTSException(String) constructor failed", ttsException); | ||
} | ||
|
||
/** | ||
* Test TTSException(Throwable cause) constructor | ||
*/ | ||
@Test | ||
public void testConstructor3() { | ||
TTSException ttsException = new TTSException(new Throwable()); | ||
Assert.assertNotNull("TTSException(Throwable) constructor failed", ttsException); | ||
} | ||
} |
Binary file added
BIN
+87.1 KB
....core.voice.test/src/test/resources/org/eclipse/smarthome/io/voice/internal/goforward.raw
Binary file not shown.
Binary file added
BIN
+91.4 KB
...ore.voice.test/src/test/resources/org/eclipse/smarthome/io/voice/internal/hellowworld.raw
Binary file not shown.
Binary file added
BIN
+120 KB
...me.core.voice.test/src/test/resources/org/eclipse/smarthome/io/voice/internal/marieta.raw
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...o/org.eclipse.smarthome.io.voice/.project → ...org.eclipse.smarthome.core.voice/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
bundles/core/org.eclipse.smarthome.core.voice/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.7 |
4 changes: 4 additions & 0 deletions
4
bundles/core/org.eclipse.smarthome.core.voice/.settings/org.eclipse.pde.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#Mon Oct 11 21:08:09 CEST 2010 | ||
eclipse.preferences.version=1 | ||
pluginProject.extensions=false | ||
resolve.requirebundle=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
bundles/core/org.eclipse.smarthome.core.voice/OSGI-INF/VoiceManager.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2014-2016 by the respective copyright holders. | ||
All rights reserved. This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License v1.0 | ||
which accompanies this distribution, and is available at | ||
http://www.eclipse.org/legal/epl-v10.html | ||
--> | ||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" configuration-policy="optional" immediate="true" modified="modified" name="org.eclipse.smarthome.voice"> | ||
<implementation class="org.eclipse.smarthome.core.voice.VoiceManager"/> | ||
<reference bind="addKSService" cardinality="0..n" interface="org.eclipse.smarthome.core.voice.KSService" name="KSService" policy="dynamic" unbind="removeKSService"/> | ||
<reference bind="addSTTService" cardinality="0..n" interface="org.eclipse.smarthome.core.voice.STTService" name="STTService" policy="dynamic" unbind="removeSTTService"/> | ||
<reference bind="addTTSService" cardinality="0..n" interface="org.eclipse.smarthome.core.voice.TTSService" name="TTSService" policy="dynamic" unbind="removeTTSService"/> | ||
<reference bind="addHumanLanguageInterpreter" cardinality="0..n" interface="org.eclipse.smarthome.core.voice.text.HumanLanguageInterpreter" name="HumanLanguageInterpreter" policy="dynamic" unbind="removeHumanLanguageInterpreter"/> | ||
<reference bind="addAudioSource" cardinality="0..n" interface="org.eclipse.smarthome.core.audio.AudioSource" name="AudioSource" policy="dynamic" unbind="removeAudioSource"/> | ||
<reference bind="addAudioSink" cardinality="0..n" interface="org.eclipse.smarthome.core.audio.AudioSink" name="AudioSink" policy="dynamic" unbind="removeAudioSink"/> | ||
<reference bind="setLocaleProvider" cardinality="1..1" interface="org.eclipse.smarthome.core.i18n.LocaleProvider" name="LocaleProvider" policy="static" unbind="unsetLocaleProvider"/> | ||
|
||
<service> | ||
<provide interface="org.eclipse.smarthome.core.voice.VoiceManager"/> | ||
</service></scr:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> | ||
<title>About</title> | ||
</head> | ||
<body lang="EN-US"> | ||
<h2>About This Content</h2> | ||
|
||
<p>June 5, 2006</p> | ||
<h3>License</h3> | ||
|
||
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise | ||
indicated below, the Content is provided to you under the terms and conditions of the | ||
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available | ||
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. | ||
For purposes of the EPL, "Program" will mean the Content.</p> | ||
|
||
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is | ||
being redistributed by another party ("Redistributor") and different terms and conditions may | ||
apply to your use of any object code in the Content. Check the Redistributor's license that was | ||
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise | ||
indicated below, the terms and conditions of the EPL still apply to any source code in the Content | ||
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> | ||
|
||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
bundles/core/org.eclipse.smarthome.core.voice/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output.. = target/classes/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/,\ | ||
about.html | ||
source.. = src/main/java/,\ | ||
src/main/resources/ |
Oops, something went wrong.