Skip to content

Commit

Permalink
追加:queryに無音時間調整関連のパラメータを作成 (#1308)
Browse files Browse the repository at this point in the history
* 追加:絶対値か倍率かのフラグ

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* 追加:絶対値か倍率かのフラグ[is_pauseLengthUseScale]

* Update tts_engine.py

* Update tts_engine.py

* Update tts_engine.py

* Update tts_engine.py

* Update tts_engine.py

* Update tts_engine.py

* Update tts_engine.py

* Update tts_engine.py

* 削除:isPauseLengthUseScale, isPauseLengthFixed

* 削除:isPauseLengthUseScale, isPauseLengthFixed

* 削除:isPauseLengthUseScale, isPauseLengthFixed

* pauseLengthをNone許容

* pauseLengthをNone許容

* 片付け

* 片付け

* 片付け

* 片付け

* 片付け

* 片付け

* Apply suggestions from code review

* テストをちょっと変更

* minimum追加

* 更新忘れ

* 「句読点などの無音時間」

---------

Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
X-20A and Hiroshiba authored Jun 7, 2024
1 parent a7d8c50 commit 3cd83de
Show file tree
Hide file tree
Showing 23 changed files with 5,747 additions and 6 deletions.
2 changes: 2 additions & 0 deletions presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
volumeScale: 1
prePhonemeLength: 0.1
postPhonemeLength: 0.1
pauseLength: null
pauseLengthScale: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/e2e/single_api/morphing/test_synthesis_morphing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def test_post_synthesis_morphing_200(client: TestClient) -> None:
"volumeScale": 1.0,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
"outputSamplingRate": 24000,
"outputStereo": False,
"kana": "テ'_スト",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/e2e/single_api/preset/test_add_preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def test_post_add_preset_200(
"volumeScale": 1,
"prePhonemeLength": 10,
"postPhonemeLength": 10,
"pauseLength": None,
"pauseLengthScale": 1,
}
response = client.post("/add_preset", params={}, json=preset)
assert response.status_code == 200
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/single_api/preset/test_update_preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def test_post_update_preset_200(
"volumeScale": 1,
"prePhonemeLength": 10,
"postPhonemeLength": 10,
"pauseLength": None,
"pauseLengthScale": 1,
}
response = client.post("/update_preset", params={}, json=preset)
assert response.status_code == 200
Expand All @@ -40,6 +42,8 @@ def test_post_update_preset_422(
"volumeScale": 404,
"prePhonemeLength": 404,
"postPhonemeLength": 404,
"pauseLength": 404,
"pauseLengthScale": 404,
}
response = client.post("/update_preset", params={}, json=preset)
assert response.status_code == 422
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def test_post_audio_query_from_preset_200(
"volumeScale": 1.3,
"prePhonemeLength": 20,
"postPhonemeLength": 5,
"pauseLength": 15,
"pauseLengthScale": 1.4,
}
client.post("/add_preset", params={}, json=preset)

Expand Down
4 changes: 4 additions & 0 deletions test/e2e/single_api/tts_pipeline/test_multi_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def test_post_multi_synthesis_200(client: TestClient) -> None:
"volumeScale": 1.0,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
"outputSamplingRate": 24000,
"outputStereo": False,
"kana": "テ'_スト",
Expand All @@ -52,6 +54,8 @@ def test_post_multi_synthesis_200(client: TestClient) -> None:
"volumeScale": 1.0,
"prePhonemeLength": 0.2,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
"outputSamplingRate": 24000,
"outputStereo": False,
"kana": "テ'_ストト",
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/single_api/tts_pipeline/test_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def test_post_synthesis_200(client: TestClient, snapshot: SnapshotAssertion) ->
"volumeScale": 1.0,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
"outputSamplingRate": 24000,
"outputStereo": False,
"kana": "テ'_スト",
Expand Down
4 changes: 4 additions & 0 deletions test/unit/preset/presets-test-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
volumeScale: 1
prePhonemeLength: 0.1
postPhonemeLength: 0.1
pauseLength: null
pauseLengthScale: 1.0

- id: 2
name: test2
Expand All @@ -19,3 +21,5 @@
volumeScale: 0.7
prePhonemeLength: 0.5
postPhonemeLength: 0.5
pauseLength: null
pauseLengthScale: 1.0
4 changes: 4 additions & 0 deletions test/unit/preset/presets-test-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
volumeScale: 1
prePhonemeLength: 0.1
postPhonemeLength: 0.1
pauseLength: null
pauseLengthScale: 1.0

- id: 2
name: test2
Expand All @@ -19,3 +21,5 @@
volumeScale: 0.7
prePhonemeLength: 0.5
postPhonemeLength: 0.5
pauseLength: null
pauseLengthScale: 1.0
4 changes: 4 additions & 0 deletions test/unit/preset/presets-test-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
volumeScale: 1
prePhonemeLength: 0.1
postPhonemeLength: 0.1
pauseLength: null
pauseLengthScale: 1.0

- id: 1
name: test2
Expand All @@ -19,3 +21,5 @@
volumeScale: 0.7
prePhonemeLength: 0.5
postPhonemeLength: 0.5
pauseLength: null
pauseLengthScale: 1.0
18 changes: 18 additions & 0 deletions test/unit/preset/test_preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def test_add_preset(tmp_path: Path) -> None:
"volumeScale": 1,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
}
)
id = preset_manager.add_preset(preset)
Expand Down Expand Up @@ -103,6 +105,8 @@ def test_add_preset_load_failure() -> None:
"volumeScale": 0,
"prePhonemeLength": 0,
"postPhonemeLength": 0,
"pauseLength": 0,
"pauseLengthScale": 0,
}
)
)
Expand All @@ -124,6 +128,8 @@ def test_add_preset_conflict_id(tmp_path: Path) -> None:
"volumeScale": 1,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
}
)
id = preset_manager.add_preset(preset)
Expand Down Expand Up @@ -151,6 +157,8 @@ def test_add_preset_conflict_id2(tmp_path: Path) -> None:
"volumeScale": 1,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
}
)
id = preset_manager.add_preset(preset)
Expand Down Expand Up @@ -178,6 +186,8 @@ def test_add_preset_write_failure(tmp_path: Path) -> None:
"volumeScale": 1,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
}
)
preset_manager.load_presets()
Expand Down Expand Up @@ -206,6 +216,8 @@ def test_update_preset(tmp_path: Path) -> None:
"volumeScale": 1,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
}
)
id = preset_manager.update_preset(preset)
Expand Down Expand Up @@ -234,6 +246,8 @@ def test_update_preset_load_failure() -> None:
"volumeScale": 0,
"prePhonemeLength": 0,
"postPhonemeLength": 0,
"pauseLength": 0,
"pauseLengthScale": 0,
}
)
)
Expand All @@ -255,6 +269,8 @@ def test_update_preset_not_found(tmp_path: Path) -> None:
"volumeScale": 1,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
}
)
true_msg = "更新先のプリセットが存在しません"
Expand All @@ -280,6 +296,8 @@ def test_update_preset_write_failure(tmp_path: Path) -> None:
"volumeScale": 1,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLength": None,
"pauseLengthScale": 1.0,
}
)
preset_manager.load_presets()
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_mock_tts_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def test_synthesize_wave() -> None:
volumeScale=1,
prePhonemeLength=0.1,
postPhonemeLength=0.1,
pauseLength=None,
pauseLengthScale=1.0,
outputSamplingRate=24000,
outputStereo=False,
kana=create_kana(_gen_accent_phrases()),
Expand Down
Loading

0 comments on commit 3cd83de

Please sign in to comment.