Skip to content

Commit

Permalink
Merge pull request #8 from umjammer/0.0.10
Browse files Browse the repository at this point in the history
0.0.10
  • Loading branch information
umjammer committed Feb 12, 2024
2 parents f40f3c0 + 91d563d commit a62126b
Show file tree
Hide file tree
Showing 17 changed files with 375 additions and 124 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: macos-latest
runs-on: macos-14

permissions:
# required for all workflows
Expand All @@ -29,7 +29,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -42,10 +42,10 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Set up JDK 1.8
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ on:
jobs:
build:

runs-on: macos-latest
runs-on: macos-14
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK 1.8
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
Expand All @@ -35,7 +35,7 @@ jobs:
run: |
mkdir tmp
echo "$GOOGLE" > tmp/google.json
mvn -B package --file pom.xml -s $GITHUB_WORKSPACE/settings.xml
mvn -B package --file pom.xml -s $GITHUB_WORKSPACE/settings.xml -Dmaven.test.skip=true
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -Dmaven.test.skip=true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven
name: Java CI

on:
push:
Expand All @@ -12,20 +12,20 @@ on:
jobs:
build:

runs-on: macos-latest
runs-on: macos-13

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check w/o SNAPSHOT when "bump version"
if: ${{ contains(github.event.head_commit.message, 'bump version') }}
run: grep "<version>" pom.xml | head -1 | grep -v SNAPSHOT

- name: Set up JDK 1.8
uses: actions/setup-java@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![GitHub Packages](https://github.com/umjammer/vavi-speech2/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/umjammer?tab=packages&repo_name=vavi-speech)
[![Java CI with Maven](https://github.com/umjammer/vavi-speech2/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-speech2/actions)
[![CodeQL](https://github.com/umjammer/vavi-speech2/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/vavi-speech2/actions/workflows/codeql-analysis.yml)
![Java](https://img.shields.io/badge/Java-8-b07219)
![Java](https://img.shields.io/badge/Java-17-b07219)

# vavi-speech2

Expand Down Expand Up @@ -76,7 +76,9 @@ Text to Speech and Speech to Text (JSAPI2) engines for Java
* wave lipsync
* https://github.com/hecomi/MMD4Mecanim-LipSync-Plugin/blob/master/Assets/LipSync/Core/LipSyncCore.cs
* VoiceVox editor compatible
* [CoeiroInk](https://coeiroink.com/)
* [CoeiroInk](https://coeiroink.com/) ... api doesn't work
* [LMROID](https://lmroidsoftware.wixsite.com/nhoshio)
* [SHAREVOX](https://www.sharevox.app)
* [http://itvoice.starfree.jp/](http://itvoice.starfree.jp/)
* AVSpeechSynthesizer needs block
* rcp client/server (wip)
119 changes: 76 additions & 43 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>vavi</groupId>
<artifactId>vavi-speech2</artifactId>
<version>0.0.9</version>
<version>0.0.10</version>

<name>vavi-speech2</name>
<description/>
Expand Down Expand Up @@ -48,7 +48,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<executions>
<execution>
<id>read-properties</id>
Expand All @@ -68,9 +68,9 @@
<!-- don't touch: this works well on github actions -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.2</version>
<configuration>
<forkMode>always</forkMode>
<reuseForks>false</reuseForks>
<trimStackTrace>false</trimStackTrace>
<systemProperties>
<sen.home>${sen.home}</sen.home>
Expand All @@ -93,6 +93,7 @@
</plugins>
</build>
</profile>

<profile>
<id>github workflow</id>
<activation>
Expand All @@ -106,10 +107,10 @@
<!-- don't touch: this works well on github actions -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.2</version>
<configuration>
<argLine>-Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties</argLine>
<forkMode>always</forkMode>
<reuseForks>false</reuseForks>
<trimStackTrace>false</trimStackTrace>
<includes>
<include>**/*Test_*.java</include>
Expand All @@ -119,8 +120,14 @@
</plugins>
</build>
</profile>

<profile>
<id>run</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -151,46 +158,57 @@
</plugins>
</build>
</profile>

<profile>
<id>mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.rococoa</groupId>
<artifactId>rococoa-core</artifactId>
<type>dylib</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<destFileName>librococoa.dylib</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.rococoa</groupId>
<artifactId>rococoa-core</artifactId>
<type>dylib</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<destFileName>librococoa.dylib</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -218,7 +236,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.9.3</version>
<version>5.10.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -241,13 +259,13 @@
<dependency>
<groupId>org.rococoa</groupId>
<artifactId>rococoa-core</artifactId>
<version>0.8.5</version>
<version>0.8.6</version>
</dependency>

<dependency>
<groupId>vavi</groupId>
<artifactId>vavi-speech</artifactId>
<version>0.1.6</version>
<version>0.1.7</version>
<exclusions>
<exclusion>
<groupId>javax.speech</groupId>
Expand All @@ -257,28 +275,43 @@
<groupId>org.jvoicexml</groupId>
<artifactId>freetts_jsapi10</artifactId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
<version>32.1.3-jre</version>
</dependency>

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-speech</artifactId>
<exclusions>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.0.9</version> <!-- 3.1.0 doesn't support java8 -->
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>3.0.9</version>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -306,7 +339,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.36</version>
<version>2.0.5</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;

import javax.speech.EngineList;
import javax.speech.EngineMode;
Expand All @@ -21,6 +22,7 @@
import com.google.cloud.texttospeech.v1.ListVoicesRequest;
import com.google.cloud.texttospeech.v1.ListVoicesResponse;
import com.google.cloud.texttospeech.v1.TextToSpeechClient;
import vavi.util.Debug;


/**
Expand Down Expand Up @@ -72,14 +74,23 @@ private List<Voice> getVoices() {
for (com.google.cloud.texttospeech.v1.Voice nativeVoice : listAllSupportedVoices()) {
Voice voice = new Voice(new SpeechLocale(nativeVoice.getLanguageCodes(0)),
nativeVoice.getName(),
nativeVoice.getSsmlGenderValue(),
toGender(nativeVoice),
Voice.AGE_DONT_CARE,
Voice.VARIANT_DONT_CARE);
voiceList.add(voice);
}
return voiceList;
}

private static int toGender(com.google.cloud.texttospeech.v1.Voice nativeVoice) {
Debug.println(Level.FINER, "nativeGender: " + nativeVoice.getName() + ", " + nativeVoice.getSsmlGenderValue());
return switch (nativeVoice.getSsmlGenderValue()) {
case 1 -> Voice.GENDER_MALE;
case 2 -> Voice.GENDER_FEMALE;
default -> Voice.GENDER_DONT_CARE;
};
}

/** */
static List<com.google.cloud.texttospeech.v1.Voice> listAllSupportedVoices() {
try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
Expand Down

0 comments on commit a62126b

Please sign in to comment.