Skip to content

Commit

Permalink
Python API、Java API、ドキュメントを更新
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed May 8, 2024
1 parent bae5bea commit 754c673
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MetaTest {
void checkLoad() {
// cwdはvoicevox_core/crates/voicevox_core_java_api/lib
String cwd = System.getProperty("user.dir");
File path = new File(cwd + "/../../../model/sample.vvm");
File path = new File(cwd + "/../../test_util/data/model/sample.vvm");
VoiceModel model = new VoiceModel(path.getAbsolutePath());
assertNotNull(model.metas);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TestUtils {
VoiceModel loadModel() {
// cwdはvoicevox_core/crates/voicevox_core_java_api/lib
String cwd = System.getProperty("user.dir");
File path = new File(cwd + "/../../../model/sample.vvm");
File path = new File(cwd + "/../../test_util/data/model/sample.vvm");

try {
return new VoiceModel(path.getCanonicalPath());
Expand Down
4 changes: 3 additions & 1 deletion crates/voicevox_core_python_api/python/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
open_jtalk_dic_dir = (
root_dir.parent.parent.parent / "test_util" / "data" / "open_jtalk_dic_utf_8-1.11"
)
model_dir = root_dir.parent.parent.parent.parent / "model" / "sample.vvm"
model_dir = (
root_dir.parent.parent.parent / "test_util" / "data" / "model" / "sample.vvm"
)


class DurationExampleData(TypedDict):
Expand Down
2 changes: 1 addition & 1 deletion docs/vvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

model は `.onnx``.bin` など様々ある。例えば `sample.vvm``predict_duration.onnx` / `predict_intonation.onnx` / `decode.onnx` を含む。

VOICEVOX OSS が提供する VVM には [`sample.vvm`](https://github.com/VOICEVOX/voicevox_core/tree/main/model) がある
VOICEVOX OSS が提供する VVM には `sample.vvm` がある(ビルドを行うと `crates/test_util/data/model/sample.vvm` が生成される)
製品版 VOICEVOX で利用される VVM は [こちらのレポジトリ](https://github.com/VOICEVOX/voicevox_fat_resource/tree/main/core/model) で確認できる。

## マニフェストファイル
Expand Down
4 changes: 2 additions & 2 deletions example/kotlin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ Options:
## 実行例

```console
./gradlew run --args="--vvm ../../model/sample.vvm"
./gradlew run --args="--vvm ../../crates/test_util/data/model/sample.vvm"
Inititalizing: AUTO, ./open_jtalk_dic_utf_8-1.11
Loading: ../../model/sample.vvm
Loading: ../../crates/test_util/data/model/sample.vvm
Creating an AudioQuery from the text: この音声は、ボイスボックスを使用して、出力されています。
Synthesizing...
Saving the audio to ./output.wav
Expand Down
4 changes: 2 additions & 2 deletions example/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ optional arguments:
## 実行例

```console
python ./run.py ../../model/sample.vvm
python ./run.py ../../crates/test_util/data/model/sample.vvm
[DEBUG] __main__: voicevox_core.supported_devices()=SupportedDevices(cpu=True, cuda=False, dml=False)
[INFO] __main__: Initializing (acceleration_mode=<AccelerationMode.AUTO: 'AUTO'>, open_jtalk_dict_dir=PosixPath('open_jtalk_dic_utf_8-1.11'))
[DEBUG] __main__: synthesizer.metas=[]
[DEBUG] __main__: synthesizer.is_gpu_mode=False
[INFO] __main__: Loading `../../model/sample.vvm`
[INFO] __main__: Loading `../../crates/test_util/data/model/sample.vvm`
[INFO] __main__: Creating an AudioQuery from 'この音声は、ボイスボックスを使用して、出力されています。'
[INFO] __main__: Synthesizing with {"accent_phrases": [{"moras": [{"text": "コ", "consonant": "k", "consonant_length": 0.0556899, "vowel": "o", "vowel_length": 0.075180575, "pitch": 5.542309}, {"text": "ノ", "consonant": "n", "consonant_length": 0.06551014, "vowel": "o", "vowel_length": 0.09984577, "pitch": 5.6173983}], "accent": 2, "pause_mora": null, "is_interrogative": false}, {"moras": [{"text": "オ", "consonant": null, "consonant_length": null, "vowel": "o", "vowel_length": 0.116150305, "pitch": 5.7063766}, {"text": "ン", "consonant": null, "consonant_length": null, "vowel": "N", "vowel_length": 0.044380233, "pitch": 5.785717}, {"text": "セ", "consonant": "s", "consonant_length": 0.07719758, "vowel": "e", "vowel_length": 0.08653869, "pitch": 5.662092}, {"text": "エ", "consonant": null, "consonant_length": null, "vowel": "e", "vowel_length": 0.08311573, "pitch": 5.532917}, {"text": "ワ", "consonant": "w", "consonant_length": 0.06373148, "vowel": "a", "vowel_length": 0.16219379, "pitch": 5.293258}], "accent": 1, "pause_mora": {"text": "、", "consonant": null, "consonant_length": null, "vowel": "pau", "vowel_length": 0.35826492, "pitch": 0.0}, "is_interrogative": false}, {"moras": [{"text": "ボ", "consonant": "b", "consonant_length": 0.047082342, "vowel": "o", "vowel_length": 0.12611786, "pitch": 5.583892}, {"text": "イ", "consonant": null, "consonant_length": null, "vowel": "i", "vowel_length": 0.059451744, "pitch": 5.7947493}, {"text": "ス", "consonant": "s", "consonant_length": 0.089278996, "vowel": "u", "vowel_length": 0.11847979, "pitch": 5.818695}, {"text": "ボ", "consonant": "b", "consonant_length": 0.06535433, "vowel": "o", "vowel_length": 0.120458946, "pitch": 5.7965107}, {"text": "ッ", "consonant": null, "consonant_length": null, "vowel": "cl", "vowel_length": 0.06940381, "pitch": 0.0}, {"text": "ク", "consonant": "k", "consonant_length": 0.053739145, "vowel": "U", "vowel_length": 0.05395376, "pitch": 0.0}, {"text": "ス", "consonant": "s", "consonant_length": 0.10222931, "vowel": "u", "vowel_length": 0.071811065, "pitch": 5.8024883}, {"text": "オ", "consonant": null, "consonant_length": null, "vowel": "o", "vowel_length": 0.11092262, "pitch": 5.5036163}], "accent": 4, "pause_mora": null, "is_interrogative": false}, {"moras": [{"text": "シ", "consonant": "sh", "consonant_length": 0.09327768, "vowel": "i", "vowel_length": 0.09126951, "pitch": 5.369444}, {"text": "ヨ", "consonant": "y", "consonant_length": 0.06251812, "vowel": "o", "vowel_length": 0.07805054, "pitch": 5.5021667}, {"text": "オ", "consonant": null, "consonant_length": null, "vowel": "o", "vowel_length": 0.09904325, "pitch": 5.5219536}], "accent": 3, "pause_mora": null, "is_interrogative": false}, {"moras": [{"text": "シ", "consonant": "sh", "consonant_length": 0.04879771, "vowel": "I", "vowel_length": 0.06514315, "pitch": 0.0}, {"text": "テ", "consonant": "t", "consonant_length": 0.0840496, "vowel": "e", "vowel_length": 0.19438823, "pitch": 5.4875555}], "accent": 2, "pause_mora": {"text": "、", "consonant": null, "consonant_length": null, "vowel": "pau", "vowel_length": 0.35208154, "pitch": 0.0}, "is_interrogative": false}, {"moras": [{"text": "シュ", "consonant": "sh", "consonant_length": 0.05436731, "vowel": "U", "vowel_length": 0.06044446, "pitch": 0.0}, {"text": "ツ", "consonant": "ts", "consonant_length": 0.102865085, "vowel": "u", "vowel_length": 0.057028636, "pitch": 5.6402535}, {"text": "リョ", "consonant": "ry", "consonant_length": 0.058293864, "vowel": "o", "vowel_length": 0.080050275, "pitch": 5.6997967}, {"text": "ク", "consonant": "k", "consonant_length": 0.054767884, "vowel": "U", "vowel_length": 0.042932786, "pitch": 0.0}], "accent": 2, "pause_mora": null, "is_interrogative": false}, {"moras": [{"text": "サ", "consonant": "s", "consonant_length": 0.08067487, "vowel": "a", "vowel_length": 0.07377973, "pitch": 5.652378}, {"text": "レ", "consonant": "r", "consonant_length": 0.040600352, "vowel": "e", "vowel_length": 0.079322875, "pitch": 5.6290326}, {"text": "テ", "consonant": "t", "consonant_length": 0.06773268, "vowel": "e", "vowel_length": 0.08347456, "pitch": 5.6427326}], "accent": 3, "pause_mora": null, "is_interrogative": false}, {"moras": [{"text": "イ", "consonant": null, "consonant_length": null, "vowel": "i", "vowel_length": 0.07542324, "pitch": 5.641289}, {"text": "マ", "consonant": "m", "consonant_length": 0.066299975, "vowel": "a", "vowel_length": 0.107257664, "pitch": 5.6201453}, {"text": "ス", "consonant": "s", "consonant_length": 0.07186453, "vowel": "U", "vowel_length": 0.1163103, "pitch": 0.0}], "accent": 2, "pause_mora": null, "is_interrogative": false}], "speed_scale": 1.0, "pitch_scale": 0.0, "intonation_scale": 1.0, "volume_scale": 1.0, "pre_phoneme_length": 0.1, "post_phoneme_length": 0.1, "output_sampling_rate": 24000, "output_stereo": false, "kana": "コノ'/オ'ンセエワ、ボイスボ'ッ_クスオ/シヨオ'/_シテ'、_シュツ' リョ_ク/サレテ'/イマ'_ス"}
[INFO] __main__: Wrote `output.wav`
Expand Down

0 comments on commit 754c673

Please sign in to comment.