mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[pipertts] Upgrade to Piper 1.4.1 & Download from JFrog (#20292)
* [pipertts] Upgrade to Piper 1.4.1 & Download from JFrog We've moved piper-jni development to a GitHub org, and upgraded to Piper 1.4.1. Signed-off-by: Florian Hotze <dev@florianhotze.com>
This commit is contained in:
@@ -14,27 +14,23 @@ https://github.com/openhab/openhab-addons
|
||||
|
||||
== Third-party Content
|
||||
|
||||
io.github.givimad: piper-jni
|
||||
* License: Apache 2.0 License
|
||||
* Project: https://github.com/GiviMAD/piper-jni
|
||||
* Source: https://github.com/GiviMAD/piper-jni
|
||||
io.github.jvoice-project: piper-jni
|
||||
* License: GPL v3.0 License as Combined Work & for JAR distributions
|
||||
* License: Apache 2.0 License for Java source and .class files
|
||||
* Project: https://github.com/jvoice-project/piper-jni
|
||||
* Source: https://github.com/jvoice-project/piper-jni
|
||||
|
||||
io.github.rhasspy: piper
|
||||
piper
|
||||
* License: GPL v3.0 License
|
||||
* Project: https://github.com/OHF-Voice/piper1-gpl
|
||||
* Source: https://github.com/OHF-Voice/piper1-gpl
|
||||
|
||||
espeak-ng
|
||||
* License: GPL v3.0 License
|
||||
* Project: https://github.com/espeak-ng/espeak-ng
|
||||
* Source: https://github.com/espeak-ng/espeak-ng
|
||||
|
||||
onnxruntime
|
||||
* License: MIT License
|
||||
* Project: https://github.com/rhasspy/piper
|
||||
* Source: https://github.com/rhasspy/piper
|
||||
|
||||
io.github.rhasspy: espeak-ng
|
||||
* License: GPL version 3, 2-clause BSD
|
||||
* Project: https://github.com/rhasspy/espeak-ng
|
||||
* Source: https://github.com/rhasspy/espeak-ng
|
||||
|
||||
io.github.rhasspy: piper-phonemize
|
||||
* License: MIT License
|
||||
* Project: https://github.com/rhasspy/piper-phonemize
|
||||
* Source: https://github.com/rhasspy/piper-phonemize
|
||||
|
||||
io.github.microsoft: onnxruntime
|
||||
* License: MIT License
|
||||
* Project: https://github.com/microsoft/onnxruntime
|
||||
* Source: https://github.com/microsoft/onnxruntime
|
||||
* Project: https://onnxruntime.ai/
|
||||
* Source: https://github.com/microsoft/onnxruntime
|
||||
|
||||
@@ -7,9 +7,9 @@ This voice service allows you to use the open source library [Piper](https://git
|
||||
|
||||
The add-on is compatible with the following platforms:
|
||||
|
||||
- linux (armv7l, aarch64, x86_64, min GLIBC version 2.31)
|
||||
- macOS (x86_64 min version 11.0, aarch64 min version 13.0)
|
||||
- win64 (x86_64 min version Windows 10).
|
||||
- Linux (x86_64/aarch64, min GLIBC version 2.31)
|
||||
- macOS (x86_64/aarch64, min. version macOS 14 Sonoma)
|
||||
- Windows (x86_64, min. version Windows 10).
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.github.givimad</groupId>
|
||||
<groupId>io.github.jvoice-project</groupId>
|
||||
<artifactId>piper-jni</artifactId>
|
||||
<version>1.2.0-c0670df</version>
|
||||
<version>1.4.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
+7
-9
@@ -72,8 +72,8 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import io.github.givimad.piperjni.PiperJNI;
|
||||
import io.github.givimad.piperjni.PiperVoice;
|
||||
import io.github.jvoiceproject.piperjni.PiperJNI;
|
||||
import io.github.jvoiceproject.piperjni.PiperVoice;
|
||||
|
||||
/**
|
||||
* The {@link PiperTTSService} class is a service implementation to use Piper for Text-to-Speech.
|
||||
@@ -87,12 +87,12 @@ import io.github.givimad.piperjni.PiperVoice;
|
||||
+ " Text-to-Speech", description_uri = SERVICE_CATEGORY + ":" + SERVICE_ID)
|
||||
public class PiperTTSService extends AbstractCachedTTSService {
|
||||
// piper-jni version from pom.xml
|
||||
private static final String PIPER_VERSION = "1.2.0-c0670df";
|
||||
private static final String PIPER_VERSION = "1.4.1";
|
||||
private static final Path PIPER_FOLDER = Path.of(OpenHAB.getUserDataFolder(), "piper");
|
||||
private static final Path LIB_FOLDER = PIPER_FOLDER.resolve("lib-" + PIPER_VERSION);
|
||||
private static final Path JAR_FILE = PIPER_FOLDER.resolve("piper-jni-" + PIPER_VERSION + ".jar");
|
||||
private static final String JAR_URL = "https://repo1.maven.org/maven2/io/github/givimad/piper-jni/" + PIPER_VERSION
|
||||
+ "/piper-jni-" + PIPER_VERSION + ".jar";
|
||||
private static final String JAR_URL = "https://openhab.jfrog.io/artifactory/libs-online-deps/io/github/jvoice-project/piper-jni/"
|
||||
+ PIPER_VERSION + "/piper-jni-" + PIPER_VERSION + ".jar";
|
||||
private final Logger logger = LoggerFactory.getLogger(PiperTTSService.class);
|
||||
private final Object modelLock = new Object();
|
||||
private final ExecutorService executor = ThreadPoolManager.getPool("voice-pipertts");
|
||||
@@ -103,7 +103,7 @@ public class PiperTTSService extends AbstractCachedTTSService {
|
||||
private @Nullable PiperJNI piper;
|
||||
private @Nullable Future<?> activateTask;
|
||||
static {
|
||||
System.setProperty("io.github.givimad.piperjni.libdir", LIB_FOLDER.toAbsolutePath().toString());
|
||||
System.setProperty("io.github.jvoiceproject.piperjni.libdir", LIB_FOLDER.toAbsolutePath().toString());
|
||||
}
|
||||
|
||||
@Activate
|
||||
@@ -118,7 +118,7 @@ public class PiperTTSService extends AbstractCachedTTSService {
|
||||
try {
|
||||
setupNativeDependencies();
|
||||
PiperJNI piper = this.piper = new PiperJNI();
|
||||
piper.initialize(true, false);
|
||||
piper.initialize(true);
|
||||
logger.debug("Using Piper version {}", piper.getPiperVersion());
|
||||
ready = true;
|
||||
} catch (IOException e) {
|
||||
@@ -149,8 +149,6 @@ public class PiperTTSService extends AbstractCachedTTSService {
|
||||
folderName = "debian-amd64";
|
||||
} else if (osArch.contains("aarch64") || osArch.contains("arm64")) {
|
||||
folderName = "debian-arm64";
|
||||
} else if (osArch.contains("armv7") || osArch.contains("arm")) {
|
||||
folderName = "debian-armv7l";
|
||||
}
|
||||
} else if (osName.contains("mac") || osName.contains("darwin")) {
|
||||
if (osArch.contains("amd64") || osArch.contains("x86_64")) {
|
||||
|
||||
Reference in New Issue
Block a user