Skip to content

Commit

Permalink
/speaker_info周りの修正 (#209)
Browse files Browse the repository at this point in the history
* ダミーのデータを追加

* resourcesに合わせてファイル名変更

* mockのspeakers情報を更新

* 画像ファイル名変更に合わせてrun.py更新
  • Loading branch information
takana-v committed Nov 30, 2021
1 parent 4d44241 commit 7ba2b10
Show file tree
Hide file tree
Showing 48 changed files with 43 additions and 5 deletions.
8 changes: 3 additions & 5 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,15 +457,13 @@ def speaker_info(speaker_uuid: str):
for style in speaker["styles"]:
id = style["id"]
icon = b64encode_str(
Path(
f"speaker_info/{speaker_uuid}/icons/{speaker['name']}_{id}.png"
).read_bytes()
Path(f"speaker_info/{speaker_uuid}/icons/{id}.png").read_bytes()
)
voice_samples = [
b64encode_str(
Path(
"speaker_info/{}/voice_samples/{}_{}_{}.wav".format(
speaker_uuid, speaker["name"], id, str(j + 1).zfill(3)
"speaker_info/{}/voice_samples/{}_{}.wav".format(
speaker_uuid, id, str(j + 1).zfill(3)
)
).read_bytes()
)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions speaker_info/35b2c544-660e-401e-b503-0e14c635303a/metas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"speakerName": "dummy3",
"speakerUuid": "dummy3uuid",
"styles": [
{
"styleId": 8
}
]
}
3 changes: 3 additions & 0 deletions speaker_info/35b2c544-660e-401e-b503-0e14c635303a/policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dummy3 policy

https://voicevox.hiroshiba.jp/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/metas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"speakerName": "dummy4",
"speakerUuid": "dummy4uuid",
"styles": [
{
"styleId": 9
}
]
}
3 changes: 3 additions & 0 deletions speaker_info/b1a81618-b27b-40d2-b0ea-27a9ad408c4b/policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dummy4 policy

https://voicevox.hiroshiba.jp/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions voicevox_engine/dev/core/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@ def metas() -> str:
"speaker_uuid": "388f246b-8c41-4ac1-8e2d-5d79f3ff56d9",
"version": version,
},
{
"name": "dummy3",
"styles": [
{"name": "style0", "id": 8},
],
"speaker_uuid": "35b2c544-660e-401e-b503-0e14c635303a",
"version": version,
},
{
"name": "dummy4",
"styles": [
{"name": "style0", "id": 9},
],
"speaker_uuid": "b1a81618-b27b-40d2-b0ea-27a9ad408c4b",
"version": version,
},
]
).replace(
"'", '"' # ちゃんとJSONとして認識してもらうためにシングルクォーテーションを置き換える
Expand Down

0 comments on commit 7ba2b10

Please sign in to comment.