https://github.com/making/voicetext4j
Java Client Library for VoiceText Web API (https://cloud.voicetext.jp/webapi)
https://github.com/making/voicetext4j
Last synced: 7 months ago
JSON representation
Java Client Library for VoiceText Web API (https://cloud.voicetext.jp/webapi)
- Host: GitHub
- URL: https://github.com/making/voicetext4j
- Owner: making
- Created: 2014-08-13T08:11:53.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-03-27T14:46:09.000Z (about 10 years ago)
- Last Synced: 2025-05-01T01:38:59.003Z (12 months ago)
- Language: Java
- Size: 51.8 KB
- Stars: 14
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VoiceText4J
Java Client Library for [VoiceText Web API](https://cloud.voicetext.jp/webapi)
[](https://travis-ci.org/making/voicetext4j)
You can use VoiceText4J with the following setting in pom.xml:
am.ik.voicetext
voicetext4j
1.0.0
## Usage
import org.junit.Test;
import am.ik.voicetext4j.*;
public class SpeakerTest {
@Test
public void testSay() throws Exception {
System.setProperty("voicetext.apikey", "API_KEY");
EmotionalSpeaker.HARUKA.ready()
.pitch(105)
.speed(105)
.very().happy()
.speak("おはようございます")
.get(); // blocking
// you can use speak(text, "API_KEY") instead of using System.setProperty("voicetext.apikey", "API_KEY")
}
}
`speak(text)` is non-blocking and returns `CompletableFuture`.
To turn this to blocking, `get()` should be called.
CompletableFuture f = EmotionalSpeaker.HARUKA.ready()
.pitch(105)
.speed(105)
.very().happy()
.speak("おはようございます")
.thenAccept(x -> System.out.println("done"));
## Quick Start using Groovy and Grape
`test.groovy`
@Grab("am.ik.voicetext:voicetext4j:0.12.0")
import am.ik.voicetext4j.*;
System.setProperty("voicetext.apikey", "API_KEY");
Speaker.SHOW.ready().speak("こんにちは");
EmotionalSpeaker.HARUKA.ready().speak("こんにちは");
EmotionalSpeaker.HIKARI.ready().speak("こんにちは");
EmotionalSpeaker.TAKERU.ready().speak("こんにちは");
EmotionalSpeaker.SANTA.ready().speak("メリークリスマス"); // new speaker from 0.11.0
EmotionalSpeaker.BEAR.ready().speak("こんにちは").get(); // new speaker from 0.12.0
run
$ groovy test.groovy
### Change emotion
`EmotionalSpeaker`s can be changed their emotion like the following:
EmotionalSpeaker.HARUKA.ready().speak("こんにちは");
EmotionalSpeaker.HARUKA.ready().angry().speak("こんにちは");
EmotionalSpeaker.HARUKA.ready().very().angry().speak("こんにちは");
EmotionalSpeaker.HARUKA.ready().happy().speak("こんにちは");
EmotionalSpeaker.HARUKA.ready().very().happy().speak("こんにちは");
EmotionalSpeaker.HARUKA.ready().sad().speak("こんにちは");
EmotionalSpeaker.HARUKA.ready().very().sad().speak("こんにちは");
## License
Licensed under the Apache License, Version 2.0.