-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from Azure-Samples/improveJavaSample
Improve Custom voice API java sample
- Loading branch information
Showing
94 changed files
with
332 additions
and
387 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,131 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>voiceSynthesis</groupId> | ||
<artifactId>voiceSynthesis-java</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<groupId>CustomVoiceAPI-Java</groupId> | ||
<artifactId>CustomVoiceAPI-Java</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<name>voiceSynthesis-java</name> | ||
<url>http://maven.apache.org</url> | ||
<name>CustomVoiceAPI-Java</name> | ||
<!-- FIXME change it to the project's website --> | ||
<url>http://www.example.com</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.7</maven.compiler.source> | ||
<maven.compiler.target>1.7</maven.compiler.target> | ||
<maven.compiler.target>1.7</maven.compiler.target> | ||
</properties> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup.okhttp</groupId> | ||
<artifactId>logging-interceptor</artifactId> | ||
<version>2.7.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup.okhttp</groupId> | ||
<artifactId>okhttp</artifactId> | ||
<version>2.7.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup.okio</groupId> | ||
<artifactId>okio</artifactId> | ||
<version>1.6.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.json</groupId> | ||
<artifactId>json</artifactId> | ||
<version>20180813</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.swagger</groupId> | ||
<artifactId>swagger-annotations</artifactId> | ||
<version>1.5.18</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.threeten</groupId> | ||
<artifactId>threetenbp</artifactId> | ||
<version>1.3.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>2.8.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.gsonfire</groupId> | ||
<artifactId>gson-fire</artifactId> | ||
<version>1.8.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-core</artifactId> | ||
<version>1.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup.okhttp</groupId> | ||
<artifactId>logging-interceptor</artifactId> | ||
<version>2.7.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup.okhttp</groupId> | ||
<artifactId>okhttp</artifactId> | ||
<version>2.7.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup.okio</groupId> | ||
<artifactId>okio</artifactId> | ||
<version>1.6.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.json</groupId> | ||
<artifactId>json</artifactId> | ||
<version>20180813</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.swagger</groupId> | ||
<artifactId>swagger-annotations</artifactId> | ||
<version>1.5.18</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.threeten</groupId> | ||
<artifactId>threetenbp</artifactId> | ||
<version>1.3.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>2.8.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.gsonfire</groupId> | ||
<artifactId>gson-fire</artifactId> | ||
<version>1.8.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-core</artifactId> | ||
<version>1.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-cli</groupId> | ||
<artifactId>commons-cli</artifactId> | ||
<version>1.4</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
|
||
<build> | ||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> | ||
<plugins> | ||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>3.1.0</version> | ||
</plugin> | ||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.0.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.0.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-install-plugin</artifactId> | ||
<version>2.5.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>2.8.2</version> | ||
</plugin> | ||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<version>3.7.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>3.0.0</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
43 changes: 43 additions & 0 deletions
43
CustomVoice-API-Samples/Java/src/main/java/CustomVoiceAPI/VoiceSynthesisLib.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,43 @@ | ||
package CustomVoiceAPI; | ||
|
||
import java.io.File; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
import io.swagger.client.ApiClient; | ||
import io.swagger.client.ApiException; | ||
import io.swagger.client.api.VoiceSynthesisApi; | ||
import io.swagger.client.model.Voice; | ||
import io.swagger.client.model.VoiceSynthesis; | ||
|
||
public class VoiceSynthesisLib { | ||
|
||
private VoiceSynthesisApi voiceApi; | ||
|
||
public VoiceSynthesisLib(ApiClient apiClient) { | ||
voiceApi = new VoiceSynthesisApi(apiClient); | ||
} | ||
|
||
public List<Voice> GetVoice() throws ApiException{ | ||
return voiceApi.getSupportedVoicesForVoiceSynthesis(); | ||
} | ||
|
||
public List<VoiceSynthesis> GetVoiceSynthesis() throws ApiException{ | ||
return voiceApi.getVoiceSyntheses(); | ||
} | ||
|
||
public VoiceSynthesis GetVoiceSynthesis(UUID id) throws ApiException{ | ||
return voiceApi.getVoiceSynthesis(id); | ||
} | ||
|
||
public void SubmitSynthesis(String name, String description, String locale, List<UUID> model, | ||
String outputFormat, String properties, File script) throws ApiException{ | ||
voiceApi.createVoiceSynthesis(name, description, locale, model, outputFormat, properties, script); | ||
return; | ||
} | ||
|
||
public void DeleteSynthesis(UUID id) throws ApiException{ | ||
voiceApi.deleteVoiceSynthesis(id); | ||
return; | ||
} | ||
} |
Oops, something went wrong.