Jirat Jaturanpinyo commited on
Commit
edc06cb
·
verified ·
1 Parent(s): a8d20c1

Upload voicevox_engine

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. voicevox_engine/.gitattributes +5 -0
  2. voicevox_engine/.github/CODEOWNERS +1 -0
  3. voicevox_engine/.github/ISSUE_TEMPLATE/bugreport.md +47 -0
  4. voicevox_engine/.github/ISSUE_TEMPLATE/featurerequest.md +48 -0
  5. voicevox_engine/.github/ISSUE_TEMPLATE/question.md +35 -0
  6. voicevox_engine/.github/PULL_REQUEST_TEMPLATE.md +24 -0
  7. voicevox_engine/.github/actions/prepare_python/action.yml +40 -0
  8. voicevox_engine/.github/workflows/build-docs.yml +38 -0
  9. voicevox_engine/.github/workflows/build-engine-container.yml +178 -0
  10. voicevox_engine/.github/workflows/build-engine-package.yml +668 -0
  11. voicevox_engine/.github/workflows/build-latest-dev.yml +49 -0
  12. voicevox_engine/.github/workflows/test-engine-container.yml +88 -0
  13. voicevox_engine/.github/workflows/test-engine-package.yml +85 -0
  14. voicevox_engine/.github/workflows/test-issue-freshness.yml +37 -0
  15. voicevox_engine/.github/workflows/test-security.yml +39 -0
  16. voicevox_engine/.github/workflows/test.yml +83 -0
  17. voicevox_engine/.gitignore +152 -0
  18. voicevox_engine/.pre-commit-config.yaml +36 -0
  19. voicevox_engine/CONTRIBUTING.md +416 -0
  20. voicevox_engine/Dockerfile +310 -0
  21. voicevox_engine/LGPL_LICENSE +165 -0
  22. voicevox_engine/LICENSE +10 -0
  23. voicevox_engine/README.md +652 -0
  24. voicevox_engine/docs/VOICEVOX音声合成エンジンとの連携.md +8 -0
  25. voicevox_engine/docs/api/.gitkeep +0 -0
  26. voicevox_engine/docs/res/マルチエンジン概念図.svg +35 -0
  27. voicevox_engine/docs/リソースファイルのURLとfilemap.md +72 -0
  28. voicevox_engine/docs/用語集.md +42 -0
  29. voicevox_engine/engine_manifest.json +78 -0
  30. voicevox_engine/poetry.lock +0 -0
  31. voicevox_engine/presets.yaml +12 -0
  32. voicevox_engine/pyproject.toml +85 -0
  33. voicevox_engine/requirements-build.txt +37 -0
  34. voicevox_engine/requirements-dev.txt +115 -0
  35. voicevox_engine/requirements.txt +29 -0
  36. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/icons/8.png +0 -0
  37. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/metas.json +3 -0
  38. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/policy.md +3 -0
  39. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/portrait.png +0 -0
  40. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/portraits/8.png +0 -0
  41. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_001.wav +0 -0
  42. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_002.wav +0 -0
  43. voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_003.wav +0 -0
  44. voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/1.png +0 -0
  45. voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/3.png +0 -0
  46. voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/5.png +0 -0
  47. voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/7.png +0 -0
  48. voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/metas.json +3 -0
  49. voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/policy.md +3 -0
  50. voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portrait.png +0 -0
voicevox_engine/.gitattributes ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ test/**/__snapshots__/**/*.json linguist-generated=true
2
+
3
+ * text=auto
4
+ *.png -text
5
+ *.wav -text
voicevox_engine/.github/CODEOWNERS ADDED
@@ -0,0 +1 @@
 
 
1
+ * @VOICEVOX/main-reviewer
voicevox_engine/.github/ISSUE_TEMPLATE/bugreport.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Bug Report
3
+ about: 不具合の報告
4
+ labels: バグ
5
+ ---
6
+
7
+ ## 不具合の内容
8
+
9
+ <!-- 概要はここに記載してください -->
10
+
11
+ ### 現象・ログ
12
+
13
+ <!-- ここに記載してください -->
14
+
15
+ ### 再現手順
16
+
17
+ <!-- 最小の構成でできると、なおよい -->
18
+
19
+ ### 期待動作
20
+
21
+ <!-- 正しいと思う動作が明確であれば記載してください -->
22
+
23
+ ## VOICEVOXのバージョン
24
+
25
+ 0.?.0
26
+
27
+ <!-- "ヘルプ" → "アップデート情報" で確認できます -->
28
+
29
+ ## OSの種類/ディストリ/バージョン
30
+
31
+ <!-- チェックするには [ ] を [x] に変更してください -->
32
+
33
+ - [ ] Windows
34
+ - [ ] macOS
35
+ - [ ] Linux
36
+
37
+ <!--
38
+ なるべく詳しく書いてください 記述例:
39
+ * Windows 10 Pro 64bit (10.0.10586)
40
+ * macOS Sierra
41
+ * Linux fedora 23 64bit
42
+ * Others
43
+ -->
44
+
45
+ ## その他
46
+
47
+ <!-- 関連して何か気がついたこと、気になることがあればココに書いてください -->
voicevox_engine/.github/ISSUE_TEMPLATE/featurerequest.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Feature Request
3
+ about: 機能要望・改善提案
4
+ labels: 機能向上
5
+ ---
6
+
7
+ ## 内容
8
+
9
+ <!-- ここに要望する機能を記載してください -->
10
+ <!-- その機能が必要な理由や、具体例も -->
11
+
12
+ ### Pros 良くなる点
13
+
14
+ <!-- 改善される状態など -->
15
+
16
+ ### Cons 悪くなる点
17
+
18
+ <!-- ないことが望ましいが、もしあるなら -->
19
+
20
+ ### 実現方法
21
+
22
+ <!-- 実現方法について検討済みであるなら -->
23
+
24
+ ## VOICEVOXのバージョン
25
+
26
+ 0.?.0
27
+
28
+ <!-- "ヘルプ" → "アップデート情報" で確認できます -->
29
+
30
+ ## OSの種類/ディストリ/バージョン
31
+
32
+ <!-- チェックするには [ ] を [x] に変更してください -->
33
+
34
+ - [ ] Windows
35
+ - [ ] macOS
36
+ - [ ] Linux
37
+
38
+ <!--
39
+ なるべく詳しく書いてください 記述例:
40
+ * Windows 10 Pro 64bit (10.0.10586)
41
+ * macOS Sierra
42
+ * Linux fedora 23 64bit
43
+ * Others
44
+ -->
45
+
46
+ ## その他
47
+
48
+ <!-- 関連して何か気がついたこと、気になることがあればココに書いてください -->
voicevox_engine/.github/ISSUE_TEMPLATE/question.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Question
3
+ about: 質問 (既存のIssueや一般事例を良く調べてからしてください)
4
+ labels: 要議論
5
+ ---
6
+
7
+ ## 質問の内容
8
+
9
+ <!-- ここに記載してください -->
10
+
11
+ ## VOICEVOXのバージョン
12
+
13
+ 0.?.0
14
+
15
+ <!-- "ヘルプ" → "アップデート情報" で確認できます -->
16
+
17
+ ## OSの種類/ディストリ/バージョン
18
+
19
+ <!-- チェックするには [ ] を [x] に変更してください -->
20
+
21
+ - [ ] Windows
22
+ - [ ] macOS
23
+ - [ ] Linux
24
+
25
+ <!--
26
+ なるべく詳しく書いてください 記述例:
27
+ * Windows 10 Pro 64bit (10.0.10586)
28
+ * macOS Sierra
29
+ * Linux fedora 23 64bit
30
+ * Others
31
+ -->
32
+
33
+ ## その他
34
+
35
+ <!-- 関連して何か気がついたこと、気になることがあればココに書いてください -->
voicevox_engine/.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## 内容
2
+
3
+ <!--
4
+ プルリクエストの内容説明を端的に記載してください。
5
+ -->
6
+
7
+ ## 関連 Issue
8
+
9
+ <!--
10
+ 関連するIssue番号を記載してください。
11
+ 番号の前に"close"を書くと自動的にIssueが閉じられます。
12
+
13
+ (例)
14
+ ref #0
15
+ close #0
16
+ -->
17
+
18
+ ## スクリーンショット・動画など
19
+
20
+ <!--
21
+ UIを変更した際は、変更がわかるような動画・スクリーンショットがあると助かります。
22
+ -->
23
+
24
+ ## その他
voicevox_engine/.github/actions/prepare_python/action.yml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "Prepare Python"
2
+ description: "Python ランタイムと依存パッケージをインストールし、Python バージョンを出力する"
3
+
4
+ inputs:
5
+ only-export-python-version:
6
+ description: "Python バージョンの出力のみをおこなうか否か"
7
+ required: false
8
+ default: "false"
9
+ requirements-suffix:
10
+ description: "依存パッケージインストール時に `rquirements` へ付ける接尾語"
11
+ required: false
12
+ default: ""
13
+ python-version:
14
+ description: "インストールされる Python ランタイムのバージョン。デフォルト値はこのリポジトリが想定する Python バージョン。"
15
+ required: false
16
+ default: "3.11.3"
17
+ outputs:
18
+ python-version:
19
+ description: "Python version"
20
+ value: ${{ steps.export-python-version.outputs.python-version }}
21
+
22
+ runs:
23
+ using: "composite"
24
+ steps:
25
+ - name: <Setup> Set up Python
26
+ if: ${{ inputs.only-export-python-version == 'false' }}
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: ${{ inputs.python-version }}
30
+ cache: pip
31
+
32
+ - name: <Setup> Install Python dependencies
33
+ if: ${{ inputs.only-export-python-version == 'false' }}
34
+ run: pip install -r requirements${{ inputs.requirements-suffix }}.txt
35
+ shell: bash
36
+
37
+ - name: <Deploy> Export Python version
38
+ id: export-python-version
39
+ run: echo "python-version=${{ inputs.python-version }}" >> $GITHUB_OUTPUT
40
+ shell: bash
voicevox_engine/.github/workflows/build-docs.yml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # API docs HTML ファイルを生成し、`gh-pages` ブランチへの push によって GitHub Pages 上のドキュメントとして公開
2
+
3
+ name: upload-docs
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - "master"
9
+
10
+ env:
11
+ PUBLISH_DIR: "./docs/api"
12
+ PUBLISH_BRANCH: "gh-pages"
13
+ DESTINATION_DIR: "api"
14
+
15
+ defaults:
16
+ run:
17
+ shell: bash
18
+
19
+ jobs:
20
+ upload-doc:
21
+ runs-on: ubuntu-20.04
22
+ steps:
23
+ - name: <Setup> Check out the repository
24
+ uses: actions/checkout@v4
25
+
26
+ - name: <Setup> Prepare Python Runtime / Python Dependencies
27
+ uses: ./.github/actions/prepare_python
28
+
29
+ - name: <Build> Make documents
30
+ run: PYTHONPATH=. python tools/make_docs.py
31
+
32
+ - name: <Deploy> Deploy documents to GitHub Pages
33
+ uses: peaceiris/actions-gh-pages@v4
34
+ with:
35
+ github_token: ${{ secrets.GITHUB_TOKEN }}
36
+ publish_dir: ${{ env.PUBLISH_DIR }}
37
+ publish_branch: ${{ env.PUBLISH_BRANCH }}
38
+ destination_dir: ${{ env.DESTINATION_DIR }}
voicevox_engine/.github/workflows/build-engine-container.yml ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: build-docker
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ release:
7
+ types:
8
+ - created
9
+ workflow_dispatch:
10
+ inputs:
11
+ version:
12
+ description: "バージョン情報(A.BB.C / A.BB.C-preview.D)"
13
+ required: true
14
+
15
+ env:
16
+ IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/voicevox_engine
17
+ VOICEVOX_RESOURCE_VERSION: "0.19.1"
18
+ VOICEVOX_CORE_VERSION: "0.15.4"
19
+
20
+ defaults:
21
+ run:
22
+ shell: bash
23
+
24
+ jobs:
25
+ config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる.
26
+ runs-on: ubuntu-latest
27
+ outputs:
28
+ version_or_latest: ${{ steps.vars.outputs.version_or_latest }}
29
+ steps:
30
+ - name: <Setup> Declare variables
31
+ id: vars
32
+ run: |
33
+ : # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る
34
+ echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> "$GITHUB_OUTPUT"
35
+
36
+ build-docker:
37
+ needs: [config]
38
+ runs-on: ${{ matrix.os }}
39
+
40
+ strategy:
41
+ matrix:
42
+ os: [ubuntu-latest]
43
+ tag:
44
+ - ""
45
+ - cpu
46
+ - cpu-ubuntu20.04
47
+ - nvidia
48
+ - nvidia-ubuntu20.04
49
+ include:
50
+ # Ubuntu 20.04
51
+ - tag: ""
52
+ target: runtime-env
53
+ base_image: ubuntu:20.04
54
+ base_runtime_image: ubuntu:20.04
55
+ onnxruntime_version: 1.13.1
56
+ platforms: linux/amd64,linux/arm64/v8
57
+ - tag: cpu
58
+ target: runtime-env
59
+ base_image: ubuntu:20.04
60
+ base_runtime_image: ubuntu:20.04
61
+ onnxruntime_version: 1.13.1
62
+ platforms: linux/amd64,linux/arm64/v8
63
+ - tag: cpu-ubuntu20.04
64
+ target: runtime-env
65
+ base_image: ubuntu:20.04
66
+ base_runtime_image: ubuntu:20.04
67
+ onnxruntime_version: 1.13.1
68
+ platforms: linux/amd64,linux/arm64/v8
69
+ - tag: nvidia
70
+ target: runtime-nvidia-env
71
+ base_image: ubuntu:20.04
72
+ base_runtime_image: nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
73
+ onnxruntime_version: 1.13.1
74
+ platforms: linux/amd64
75
+ - tag: nvidia-ubuntu20.04
76
+ target: runtime-nvidia-env
77
+ base_image: ubuntu:20.04
78
+ base_runtime_image: nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
79
+ onnxruntime_version: 1.13.1
80
+ platforms: linux/amd64
81
+
82
+ steps:
83
+ - name: <Setup> Check out the repository
84
+ uses: actions/checkout@v4
85
+
86
+ - name: <Setup> Prepare Python version
87
+ id: prepare-python
88
+ uses: ./.github/actions/prepare_python
89
+ with:
90
+ only-export-python-version: true
91
+
92
+ - name: <Setup> Set up QEMU
93
+ uses: docker/setup-qemu-action@v3
94
+
95
+ - name: <Setup> Set up Docker Buildx
96
+ id: buildx
97
+ uses: docker/setup-buildx-action@v3
98
+
99
+ - name: <Setup> Login to DockerHub
100
+ uses: docker/login-action@v3
101
+ with:
102
+ username: ${{ vars.DOCKERHUB_USERNAME }}
103
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
104
+
105
+ - name: <Setup> Prepare VOICEVOX RESOURCE cache
106
+ uses: actions/cache@v4
107
+ id: voicevox-resource-cache
108
+ with:
109
+ key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }}
110
+ path: download/resource
111
+
112
+ - name: <Setup> Check out the VOICEVOX RESOURCE repository
113
+ if: steps.voicevox-resource-cache.outputs.cache-hit != 'true'
114
+ uses: actions/checkout@v4
115
+ with:
116
+ repository: VOICEVOX/voicevox_resource
117
+ ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
118
+ path: download/resource
119
+
120
+ - name: <Build> Merge VOICEVOX RESOURCE
121
+ env:
122
+ DOWNLOAD_RESOURCE_PATH: download/resource
123
+ run: bash tools/process_voicevox_resource.bash
124
+
125
+ - name: <Build/Deploy> Build and Deploy Docker image
126
+ uses: docker/build-push-action@v5
127
+ env:
128
+ IMAGE_TAG:
129
+ |- # If it's a release, add the version, otherwise add the `latest`
130
+ ${{ (
131
+ matrix.tag != '' && (
132
+ format('{0}:{1}-{2}', env.IMAGE_NAME, matrix.tag, needs.config.outputs.version_or_latest)
133
+ ) || format('{0}:{1}', env.IMAGE_NAME, needs.config.outputs.version_or_latest)
134
+ ) }}
135
+ IMAGE_CACHE_FROM:
136
+ |- # Always use the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache
137
+ ${{ (
138
+ matrix.tag != '' && (
139
+ format('type=registry,ref={0}:{1}-latest-buildcache', env.IMAGE_NAME, matrix.tag)
140
+ ) || format('type=registry,ref={0}:latest-buildcache', env.IMAGE_NAME)
141
+ ) }}
142
+ IMAGE_CACHE_TO:
143
+ |- # If it's a release, do not create buildcache, otherwise create the `latest` buildcache. :latest-buildcache or :{tag}-latest-buildcache
144
+ ${{ (
145
+ needs.config.outputs.version_or_latest == 'latest' && (
146
+ matrix.tag != '' && (
147
+ format('type=registry,ref={0}:{1}-latest-buildcache,mode=max', env.IMAGE_NAME, matrix.tag)
148
+ ) || format('type=registry,ref={0}:latest-buildcache,mode=max', env.IMAGE_NAME)
149
+ ) || ''
150
+ ) }}
151
+ with:
152
+ context: .
153
+ builder: ${{ steps.buildx.outputs.name }}
154
+ file: ./Dockerfile
155
+ build-args: |
156
+ BASE_IMAGE=${{ matrix.base_image }}
157
+ BASE_RUNTIME_IMAGE=${{ matrix.base_runtime_image }}
158
+ PYTHON_VERSION=${{ steps.prepare-python.outputs.python-version }}
159
+ VOICEVOX_ENGINE_VERSION=${{ needs.config.outputs.version_or_latest }}
160
+ VOICEVOX_CORE_VERSION=${{ env.VOICEVOX_CORE_VERSION }}
161
+ VOICEVOX_RESOURCE_VERSION=${{ env.VOICEVOX_RESOURCE_VERSION }}
162
+ USE_GPU=${{ matrix.target == 'runtime-nvidia-env' }}
163
+ ONNXRUNTIME_VERSION=${{ matrix.onnxruntime_version }}
164
+ target: ${{ matrix.target }}
165
+ push: true
166
+ tags: ${{ env.IMAGE_TAG }}
167
+ cache-from: ${{ env.IMAGE_CACHE_FROM }}
168
+ cache-to: ${{ env.IMAGE_CACHE_TO }}
169
+ platforms: ${{ matrix.platforms }}
170
+
171
+ run-release-test-workflow:
172
+ # version が指定されている場合のみ実行する
173
+ if: needs.config.outputs.version_or_latest != 'latest'
174
+ needs: [config, build-docker]
175
+ uses: ./.github/workflows/test-engine-container.yml
176
+ with:
177
+ version: ${{ needs.config.outputs.version_or_latest }}
178
+ repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL
voicevox_engine/.github/workflows/build-engine-package.yml ADDED
@@ -0,0 +1,668 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: build
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ release:
7
+ types:
8
+ - created
9
+ workflow_dispatch:
10
+ inputs:
11
+ version:
12
+ description: "バージョン情報(A.BB.C / A.BB.C-preview.D)"
13
+ required: true
14
+ prerelease:
15
+ description: "プレリリースかどうか"
16
+ type: boolean
17
+ default: true
18
+ code_signing:
19
+ description: "コード署名する"
20
+ type: boolean
21
+ default: false
22
+ upload_artifact:
23
+ description: "デバッグ用に成果物をartifactにアップロードするか"
24
+ type: boolean
25
+ default: false
26
+
27
+ env:
28
+ VOICEVOX_RESOURCE_VERSION: "0.19.1"
29
+ VOICEVOX_CORE_VERSION: "0.15.4"
30
+
31
+ defaults:
32
+ run:
33
+ shell: bash
34
+
35
+ jobs:
36
+ config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる.
37
+ runs-on: ubuntu-latest
38
+ outputs:
39
+ version: ${{ steps.vars.outputs.version }}
40
+ version_or_latest: ${{ steps.vars.outputs.version_or_latest }}
41
+ steps:
42
+ - name: <Setup> Declare variables
43
+ id: vars
44
+ run: |
45
+ : # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列
46
+ echo "version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
47
+ : # release タグ名, または workflow_dispatch でのバージョン名, または 'latest'
48
+ echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> "$GITHUB_OUTPUT"
49
+
50
+ build-and-upload:
51
+ needs: [config]
52
+ environment: ${{ github.event.inputs.code_signing == 'true' && 'code_signing' || '' }} # コード署名用のenvironment
53
+ strategy:
54
+ matrix:
55
+ include:
56
+ # Windows CPU
57
+ - os: windows-2019
58
+ architecture: "x64"
59
+ voicevox_core_asset_prefix: voicevox_core-windows-x64-cpu
60
+ onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-1.13.1.zip
61
+ target: windows-cpu
62
+ # Windows DirectML
63
+ - os: windows-2019
64
+ architecture: "x64"
65
+ voicevox_core_asset_prefix: voicevox_core-windows-x64-directml
66
+ onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/Microsoft.ML.OnnxRuntime.DirectML.1.13.1.zip
67
+ directml_url: https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.10.0
68
+ target: windows-directml
69
+ # Windows NVIDIA GPU
70
+ - os: windows-2019
71
+ architecture: "x64"
72
+ voicevox_core_asset_prefix: voicevox_core-windows-x64-cuda
73
+ onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-gpu-1.13.1.zip
74
+ cuda_version: "11.8.0"
75
+ cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.2.26_cuda11-archive.zip
76
+ zlib_url: http://www.winimage.com/zLibDll/zlib123dllx64.zip
77
+ target: windows-nvidia
78
+ # Mac CPU (x64 arch)
79
+ - os: macos-12
80
+ architecture: "x64"
81
+ voicevox_core_asset_prefix: voicevox_core-osx-x64-cpu
82
+ onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-osx-x86_64-1.13.1.tgz
83
+ target: macos-x64
84
+ # Mac CPU (arm64 arch)
85
+ - os: macos-14
86
+ architecture: "arm64"
87
+ voicevox_core_asset_prefix: voicevox_core-osx-arm64-cpu
88
+ onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-osx-arm64-1.13.1.tgz
89
+ target: macos-arm64
90
+ # Linux CPU
91
+ - os: ubuntu-20.04
92
+ architecture: "x64"
93
+ voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
94
+ onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz
95
+ target: linux-cpu
96
+ # Linux NVIDIA GPU
97
+ - os: ubuntu-20.04
98
+ architecture: "x64"
99
+ voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu
100
+ onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz
101
+ cuda_version: "11.8.0"
102
+ cudnn_url: https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.2.26_cuda11-archive.tar.xz
103
+ target: linux-nvidia
104
+
105
+ runs-on: ${{ matrix.os }}
106
+
107
+ env:
108
+ # GNUコマンド
109
+ sed: ${{ startsWith(matrix.os, 'macos-') && 'gsed' || 'sed' }}
110
+ split: ${{ startsWith(matrix.os, 'macos-') && 'gsplit' || 'split' }}
111
+
112
+ steps:
113
+ - name: <Setup> Declare variables
114
+ id: vars
115
+ run: echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> "$GITHUB_OUTPUT"
116
+
117
+ - name: <Setup> Check out the repository
118
+ uses: actions/checkout@v4
119
+
120
+ # NOTE: The default 'sed' and 'split' of macOS is BSD 'sed' and 'split'.
121
+ # There is a difference in specification between BSD 'sed' and 'split' and GNU 'sed' and 'split',
122
+ # so you need to install GNU 'sed' and 'split'.
123
+ - name: <Setup> Install dependencies (macOS)
124
+ if: startsWith(matrix.os, 'macos-')
125
+ run: brew install gnu-sed coreutils
126
+
127
+ # ONNX Runtime providersとCUDA周りをリンクするために使う
128
+ - name: <Setup> Install ONNX Runtime dependencies (Linux)
129
+ if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia')
130
+ run: |
131
+ sudo apt-get update
132
+ sudo apt-get install -y patchelf
133
+
134
+ # CUDA
135
+ - name: <Setup> Restore cached CUDA
136
+ if: matrix.cuda_version != ''
137
+ uses: actions/cache/restore@v4
138
+ id: cuda-dll-cache-restore
139
+ with:
140
+ # update this key when ONNX Runtime CUDA dependency changed
141
+ key: ${{ matrix.os }}-cuda-dll-${{ matrix.cuda_version }}-v1
142
+ path: download/cuda
143
+
144
+ - name: <Setup> Set up CUDA toolkit
145
+ if: matrix.cuda_version != '' && steps.cuda-dll-cache-restore.outputs.cache-hit != 'true'
146
+ uses: Jimver/cuda-toolkit@v0.2.15
147
+ id: cuda-toolkit
148
+ with:
149
+ method: network
150
+ cuda: ${{ matrix.cuda_version }}
151
+
152
+ - name: <Setup> Extract CUDA Dynamic Libraries
153
+ if: matrix.cuda_version != '' && steps.cuda-dll-cache-restore.outputs.cache-hit != 'true'
154
+ run: |
155
+ set -eux
156
+
157
+ # CUDA Toolkit へのパスを OS 非依存へ整形する
158
+ # NOTE: ダブルクォートでバックスラッシュを囲むと tr が可搬性関連の warning を出す
159
+ # shellcheck disable=SC1003
160
+ CUDA_ROOT=$( echo "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}" | tr '\\' '/' )
161
+
162
+ mkdir -p download/cuda/bin
163
+ # NOTE 1: actionlint による GitHub Actions 文法の暗示的 `________________` 置換が SchellCheck の `never be equal` エラーを起こさないように、変数代入する
164
+ # 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
165
+ OS=${{ matrix.os }}
166
+ if [[ $OS == windows-* ]]; then
167
+ mv "${CUDA_ROOT}/bin/"*.dll download/cuda/bin/
168
+
169
+ # remove CUDA to reduce disk usage
170
+ rm -rf "${CUDA_ROOT}"
171
+ else
172
+ cp "${CUDA_ROOT}/lib64/"libcublas.so.* download/cuda/bin/
173
+ cp "${CUDA_ROOT}/lib64/"libcublasLt.so.* download/cuda/bin/
174
+ cp "${CUDA_ROOT}/lib64/"libcudart.so.* download/cuda/bin/
175
+ cp "${CUDA_ROOT}/lib64/"libcufft.so.* download/cuda/bin/
176
+ cp "${CUDA_ROOT}/lib64/"libcurand.so.* download/cuda/bin/
177
+
178
+ # remove unneed full version libraries
179
+ rm -f download/cuda/bin/libcublas.so.*.*
180
+ rm -f download/cuda/bin/libcublasLt.so.*.*
181
+ rm -f download/cuda/bin/libcufft.so.*.*
182
+ rm -f download/cuda/bin/libcurand.so.*.*
183
+ rm -f download/cuda/bin/libcudart.so.*.*.*
184
+
185
+ # remove CUDA to reduce disk usage
186
+ sudo rm -rf "${CUDA_ROOT}"
187
+ fi
188
+
189
+ - name: <Setup> Save CUDA cache
190
+ if: matrix.cuda_version != ''
191
+ uses: actions/cache/save@v4
192
+ with:
193
+ key: ${{ steps.cuda-dll-cache-restore.outputs.cache-primary-key }}
194
+ path: download/cuda
195
+
196
+ # cuDNN
197
+ - name: <Setup> Export cuDNN url to calc hash
198
+ if: matrix.cudnn_url != ''
199
+ run: echo "${{ matrix.cudnn_url }}" > download/cudnn_url.txt
200
+
201
+ - name: <Setup> Restore cached cuDNN
202
+ if: matrix.cudnn_url != ''
203
+ uses: actions/cache/restore@v4
204
+ id: cudnn-dll-cache-restore
205
+ with:
206
+ # update this key when ONNX Runtime cuDNN dependency changed
207
+ key: ${{ matrix.os }}-cudnn-dll-${{ hashFiles('download/cudnn_url.txt') }}-v1
208
+ path: download/cudnn
209
+
210
+ - name: <Setup> Download and extract cuDNN Dynamic Libraries
211
+ if: matrix.cudnn_url != '' && steps.cudnn-dll-cache-restore.outputs.cache-hit != 'true'
212
+ run: |
213
+ set -eux
214
+
215
+ # 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
216
+ OS=${{ matrix.os }}
217
+ if [[ $OS == windows-* ]]; then
218
+ curl -L "${{ matrix.cudnn_url }}" > download/cudnn.zip
219
+
220
+ unzip download/cudnn.zip cudnn-*/bin/*.dll -d download/cudnn_tmp
221
+
222
+ mkdir -p download/cudnn/bin
223
+ mv download/cudnn_tmp/cudnn-*/bin/*.dll download/cudnn/bin/
224
+ rm -rf download/cudnn_tmp
225
+
226
+ rm download/cudnn.zip
227
+ else
228
+ curl -L "${{ matrix.cudnn_url }}" > download/cudnn.tar.xz
229
+
230
+ tar -Jxf download/cudnn.tar.xz -C download/
231
+
232
+ mkdir -p download/cudnn/bin
233
+ cp download/cudnn-*/lib/libcudnn.so.* download/cudnn/bin/
234
+ cp download/cudnn-*/lib/libcudnn_*_infer.so.* download/cudnn/bin/
235
+
236
+ # remove unneed full version libraries
237
+ rm -f download/cudnn/bin/libcudnn.so.*.*
238
+ rm -f download/cudnn/bin/libcudnn_*_infer.so.*.*
239
+
240
+ rm download/cudnn.tar.xz
241
+ fi
242
+
243
+ - name: <Setup> Save cuDNN cache
244
+ if: matrix.cudnn_url != ''
245
+ uses: actions/cache/save@v4
246
+ with:
247
+ key: ${{ steps.cudnn-dll-cache-restore.outputs.cache-primary-key }}
248
+ path: download/cudnn
249
+
250
+ # zlib
251
+ - name: <Setup> Export zlib url to calc hash
252
+ if: matrix.zlib_url != ''
253
+ run: echo "${{ matrix.zlib_url }}" >> download/zlib_url.txt
254
+
255
+ - name: <Setup> Restore cached zlib
256
+ if: matrix.zlib_url != ''
257
+ uses: actions/cache/restore@v4
258
+ id: zlib-cache-restore
259
+ with:
260
+ key: zlib-cache-v1-${{ hashFiles('download/zlib_url.txt') }}
261
+ path: download/zlib
262
+
263
+ - name: <Setup> Download zlib dynamic Library
264
+ if: steps.zlib-cache-restore.outputs.cache-hit != 'true' && matrix.zlib_url != ''
265
+ run: |
266
+ curl -L "${{ matrix.zlib_url }}" -o download/zlib.zip
267
+ mkdir -p download/zlib
268
+
269
+ # extract only dlls
270
+ unzip download/zlib.zip dll_${{ matrix.architecture }}/zlibwapi.dll -d download/zlib
271
+ rm download/zlib.zip
272
+ mv download/zlib/dll_${{ matrix.architecture }}/zlibwapi.dll download/zlib/zlibwapi.dll
273
+ rm -r download/zlib/dll_${{ matrix.architecture }}
274
+
275
+ - name: <Setup> Save zlib cache
276
+ if: matrix.zlib_url != ''
277
+ uses: actions/cache/save@v4
278
+ with:
279
+ key: ${{ steps.zlib-cache-restore.outputs.cache-primary-key }}
280
+ path: download/zlib
281
+
282
+ - name: <Setup> Set up MSVC
283
+ if: startsWith(matrix.os, 'windows-')
284
+ uses: ilammy/msvc-dev-cmd@v1
285
+
286
+ - name: <Setup> Prepare Python Runtime / Python Dependencies
287
+ uses: ./.github/actions/prepare_python
288
+ with:
289
+ requirements-suffix: "-build"
290
+
291
+ - name: <Setup> Prepare custom PyInstaller
292
+ if: startsWith(matrix.os, 'windows-')
293
+ run: ./tools/modify_pyinstaller.bash
294
+
295
+ - name: <Setup> Download pyopenjtalk dictionary
296
+ run: |
297
+ # try 5 times, sleep 5 seconds before retry
298
+ for _ in $(seq 5); do
299
+ EXIT_CODE=0
300
+ python3 -c "import pyopenjtalk; pyopenjtalk._lazy_init()" || EXIT_CODE=$?
301
+
302
+ if [ "$EXIT_CODE" = "0" ]; then
303
+ break
304
+ fi
305
+
306
+ sleep 5
307
+ done
308
+
309
+ if [ "$EXIT_CODE" != "0" ]; then
310
+ exit "$EXIT_CODE"
311
+ fi
312
+
313
+ - name: <Setup> Create download directory
314
+ run: mkdir -p download/
315
+
316
+ # DirectML
317
+ - name: <Setup> Export DirectML url to calc hash
318
+ if: endswith(matrix.target, '-directml')
319
+ run: echo "${{ matrix.directml_url }}" >> download/directml_url.txt
320
+
321
+ - name: <Setup> Restore cached DirectML
322
+ if: endswith(matrix.target, '-directml')
323
+ uses: actions/cache/restore@v4
324
+ id: directml-cache-restore
325
+ with:
326
+ key: directml-cache-v1-${{ hashFiles('download/directml_url.txt') }}
327
+ path: download/directml
328
+
329
+ - name: <Setup> Set up DirectML dynamic Library
330
+ if: steps.directml-cache-restore.outputs.cache-hit != 'true' && endswith(matrix.target, '-directml')
331
+ run: |
332
+ curl -L "${{ matrix.directml_url }}" -o download/directml.zip
333
+ mkdir -p download/directml
334
+
335
+ # extract only dlls
336
+ unzip download/directml.zip bin/${{ matrix.architecture }}-win/DirectML.dll -d download/directml
337
+ rm download/directml.zip
338
+ mv download/directml/bin/${{ matrix.architecture }}-win/DirectML.dll download/directml/DirectML.dll
339
+ rm -r download/directml/bin
340
+
341
+ - name: <Setup> Save DirectML cache
342
+ if: endswith(matrix.target, '-directml')
343
+ uses: actions/cache/save@v4
344
+ with:
345
+ key: ${{ steps.directml-cache-restore.outputs.cache-primary-key }}
346
+ path: download/directml
347
+
348
+ # ONNX Runtime
349
+ - name: <Setup> Export ONNX Runtime url to calc hash
350
+ run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt
351
+
352
+ - name: <Setup> Restore cached ONNX Runtime
353
+ uses: actions/cache/restore@v4
354
+ id: onnxruntime-cache-restore
355
+ with:
356
+ key: ${{ matrix.os }}-onnxruntime-${{ hashFiles('download/onnxruntime_url.txt') }}-v1
357
+ path: download/onnxruntime
358
+
359
+ - name: <Setup> Download ONNX Runtime (Windows)
360
+ if: steps.onnxruntime-cache-restore.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-')
361
+ run: |
362
+ curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip
363
+
364
+ # extract only dlls
365
+ # 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
366
+ TARGET=${{ matrix.target }}
367
+ if [[ $TARGET != *-directml ]]; then
368
+ unzip download/onnxruntime.zip onnxruntime-*/lib/*.dll -d download/
369
+ mv download/onnxruntime-* download/onnxruntime
370
+ else
371
+ mkdir -p download/onnxruntime/lib
372
+ unzip download/onnxruntime.zip runtimes/win-${{ matrix.architecture }}/native/*.dll -d download/onnxruntime
373
+ mv download/onnxruntime/runtimes/win-${{ matrix.architecture }}/native/*.dll download/onnxruntime/lib/
374
+ rm -r download/onnxruntime/runtimes
375
+ fi
376
+
377
+ rm download/onnxruntime.zip
378
+
379
+ - name: <Setup> Download ONNX Runtime (Mac/Linux)
380
+ if: steps.onnxruntime-cache-restore.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-') != true
381
+ run: |
382
+ curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.tgz
383
+ mkdir -p download/onnxruntime
384
+ tar xf "download/onnxruntime.tgz" -C "download/onnxruntime" --strip-components 1
385
+ rm download/onnxruntime.tgz
386
+
387
+ - name: <Setup> Save ONNX Runtime cache
388
+ uses: actions/cache/save@v4
389
+ with:
390
+ key: ${{ steps.onnxruntime-cache-restore.outputs.cache-primary-key }}
391
+ path: download/onnxruntime
392
+
393
+ # VOICEVOX RESOURCE
394
+ - name: <Setup> Prepare RESOURCE cache
395
+ uses: actions/cache@v4
396
+ id: voicevox-resource-cache
397
+ with:
398
+ key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }}
399
+ path: download/resource
400
+
401
+ - name: <Setup> Check out RESOURCE repository
402
+ if: steps.voicevox-resource-cache.outputs.cache-hit != 'true'
403
+ uses: actions/checkout@v4
404
+ with:
405
+ repository: VOICEVOX/voicevox_resource
406
+ ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
407
+ path: download/resource
408
+
409
+ - name: <Build> Merge RESOURCE
410
+ env:
411
+ DOWNLOAD_RESOURCE_PATH: download/resource
412
+ run: bash tools/process_voicevox_resource.bash
413
+
414
+ # VOICEVOX CORE
415
+ - name: <Setup> Prepare CORE cache
416
+ uses: actions/cache@v4
417
+ id: voicevox-core-cache
418
+ with:
419
+ key: ${{ matrix.os }}-voicevox-core-${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
420
+ path: download/core
421
+
422
+ - name: <Setup> Download CORE
423
+ if: steps.voicevox-core-cache.outputs.cache-hit != 'true'
424
+ env:
425
+ VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
426
+ run: |
427
+ curl -L "https://github.com/VOICEVOX/voicevox_core/releases/download/${{ env.VOICEVOX_CORE_VERSION }}/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip" > download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
428
+ # 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
429
+ OS=${{ matrix.os }}
430
+ if [[ $OS == mac-* ]]; then
431
+ ditto -x -k --sequesterRsrc --rsrc download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip download/
432
+ else
433
+ unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/
434
+ fi
435
+ mkdir -p download/core
436
+ mv download/${{ env.VOICEVOX_CORE_ASSET_NAME }}/* download/core
437
+ rm -rf download/${{ env.VOICEVOX_CORE_ASSET_NAME }}
438
+ rm download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
439
+
440
+ # Build
441
+ - name: <Build> Generate licenses.json
442
+ run: |
443
+ OUTPUT_LICENSE_JSON_PATH=resources/engine_manifest_assets/dependency_licenses.json \
444
+ bash tools/create_venv_and_generate_licenses.bash
445
+ # FIXME: VOICEVOX (editor) cannot build without licenses.json
446
+ cp resources/engine_manifest_assets/dependency_licenses.json licenses.json
447
+
448
+ - name: <Build> Generate filemap.json
449
+ run: python tools/generate_filemap.py --target_dir resources/character_info
450
+
451
+ - name: <Build> Build VOICEVOX ENGINE run.py
452
+ run: |
453
+ set -eux
454
+
455
+ jq '.version = "${{ needs.config.outputs.version_or_latest }}"' engine_manifest.json > engine_manifest.json.tmp
456
+ mv -f engine_manifest.json.tmp engine_manifest.json
457
+
458
+ # Replace version & specify dynamic libraries
459
+ $sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version_or_latest }}\"/" voicevox_engine/__init__.py
460
+ # 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
461
+ OS=${{ matrix.os }}
462
+ if [[ $OS == windows-* ]]; then
463
+ LIBCORE_PATH=download/core/voicevox_core.dll
464
+ LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll
465
+ elif [[ $OS == macos-* ]]; then
466
+ LIBCORE_PATH=download/core/libvoicevox_core.dylib
467
+ LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib
468
+ else
469
+ LIBCORE_PATH=download/core/libvoicevox_core.so
470
+ LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.so
471
+ fi
472
+
473
+ CORE_MODEL_DIR_PATH="download/core/model" \
474
+ LIBCORE_PATH="$LIBCORE_PATH" \
475
+ LIBONNXRUNTIME_PATH="$LIBONNXRUNTIME_PATH" \
476
+ pyinstaller --noconfirm run.spec
477
+
478
+ # Because PyInstaller does not copy dynamic loaded libraries,
479
+ # manually move DLL dependencies into `dist/run/` (cache already saved)
480
+
481
+ - name: <Build> Gather DLL dependencies (Windows)
482
+ if: startsWith(matrix.os, 'windows-')
483
+ run: |
484
+ set -eux
485
+
486
+ # Windows CUDA
487
+ if [ -f "download/onnxruntime/lib/onnxruntime_providers_cuda.dll" ]; then
488
+
489
+ # ONNX Runtime providers
490
+ mv download/onnxruntime/lib/onnxruntime_*.dll dist/run/
491
+
492
+ # CUDA
493
+ mv download/cuda/bin/cublas64_*.dll dist/run/
494
+ mv download/cuda/bin/cublasLt64_*.dll dist/run/
495
+ mv download/cuda/bin/cudart64_*.dll dist/run/
496
+ mv download/cuda/bin/cufft64_*.dll dist/run/
497
+ mv download/cuda/bin/curand64_*.dll dist/run/
498
+
499
+ # cuDNN
500
+ mv download/cudnn/bin/cudnn64_*.dll dist/run/
501
+ mv download/cudnn/bin/cudnn_*_infer64*.dll dist/run/
502
+
503
+ # zlib
504
+ mv download/zlib/zlibwapi.dll dist/run/
505
+
506
+ # Clean source directories to reduce disk usage (already cached)
507
+ rm -rf download/onnxruntime
508
+ rm -rf download/cuda
509
+ rm -rf download/cudnn
510
+ rm -rf download/zlib
511
+ fi
512
+
513
+ # Windows DirectML
514
+ # 一度代入して actionlint のエラー回避 (詳細: NOTE 1)
515
+ TARGET=${{ matrix.target }}
516
+ if [[ $TARGET == *-directml ]]; then
517
+ # DirectML
518
+ mv download/directml/DirectML.dll dist/run/
519
+
520
+ # Clean source directories (already cached)
521
+ rm -rf download/directml
522
+ fi
523
+
524
+ - name: <Build> Gather DLL dependencies (Linux CUDA)
525
+ if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia')
526
+ run: |
527
+ set -eux
528
+
529
+ # ONNX Runtime providers
530
+ # NOTE: `$ORIGIN` は RPATH の特殊トークンであるため、bash 変数扱いされないために適切なエスケープが必要。
531
+ # shellcheck disable=SC2016
532
+ patchelf --set-rpath '$ORIGIN' "$(pwd)/download/onnxruntime/lib"/libonnxruntime_providers_*.so
533
+ mv download/onnxruntime/lib/libonnxruntime_*.so dist/run/
534
+
535
+ # CUDA
536
+ mv download/cuda/bin/libcublas.so.* dist/run/
537
+ mv download/cuda/bin/libcublasLt.so.* dist/run/
538
+ mv download/cuda/bin/libcudart.so.* dist/run/
539
+ mv download/cuda/bin/libcufft.so.* dist/run/
540
+ mv download/cuda/bin/libcurand.so.* dist/run/
541
+
542
+ # cuDNN
543
+ mv download/cudnn/bin/libcudnn.so.* dist/run/
544
+ mv download/cudnn/bin/libcudnn_*_infer.so.* dist/run/
545
+
546
+ # Clean source directories to reduce disk usage (already cached)
547
+ rm -rf download/onnxruntime
548
+ rm -rf download/cuda
549
+ rm -rf download/cudnn
550
+
551
+ - name: <Build> Code signing
552
+ if: github.event.inputs.code_signing == 'true' && startsWith(matrix.os, 'windows-')
553
+ run: bash tools/codesign.bash "dist/run/run.exe"
554
+ env:
555
+ ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }}
556
+ ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }}
557
+ ESIGNERCKA_TOTP_SECRET: ${{ secrets.ESIGNERCKA_TOTP_SECRET }}
558
+
559
+ - name: <Build> Rename artifact directory to archive
560
+ run: mv dist/run/ "${{ matrix.target }}/"
561
+
562
+ # 7z archives
563
+ - name: <Build> Create 7z archives
564
+ run: |
565
+ # Compress to artifact.7z.001, artifact.7z.002, ...
566
+ 7z -r -v1900m a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.target }}/"
567
+
568
+ # Output splitted archive list
569
+ ls ${{ steps.vars.outputs.package_name }}.7z.* > archives_7z.txt
570
+ mv archives_7z.txt "${{ steps.vars.outputs.package_name }}.7z.txt"
571
+
572
+ - name: <Deploy> Upload 7z archives to artifact
573
+ if: github.event.inputs.upload_artifact == 'true'
574
+ uses: actions/upload-artifact@v4
575
+ with:
576
+ name: ${{ steps.vars.outputs.package_name }}-7z
577
+ path: |
578
+ ${{ steps.vars.outputs.package_name }}.7z.*
579
+
580
+ - name: <Deploy> Upload 7z archives to Release assets
581
+ if: needs.config.outputs.version != ''
582
+ uses: ncipollo/release-action@v1
583
+ with:
584
+ allowUpdates: true
585
+ prerelease: ${{ github.event.inputs.prerelease }}
586
+ token: ${{ secrets.GITHUB_TOKEN }}
587
+ tag: ${{ needs.config.outputs.version }}
588
+ artifacts: >
589
+ ${{ steps.vars.outputs.package_name }}.7z.*
590
+ commit: ${{ github.sha }}
591
+
592
+ - name: <Setup> Clean 7z archives to reduce disk usage
593
+ run: rm -f ${{ steps.vars.outputs.package_name }}.7z.*
594
+
595
+ # VVPP archives
596
+ - name: <Build> Create VVPP archives
597
+ run: |
598
+ # Compress to compressed.zip.001, compressed.zip.002, ...
599
+ # NOTE: 1000th archive will be "compressed.zip.1000" after "compressed.zip.999". This is unconsidered as an extreme case.
600
+ (cd "${{ matrix.target }}" && 7z -r -v1900M a "../compressed.zip")
601
+
602
+ # Rename to artifact.001.vvppp, artifact.002.vvppp, ...
603
+ for FILE in compressed.zip.*; do
604
+ NUMBER=${FILE##*.} # 001
605
+ mv "${FILE}" "${{ steps.vars.outputs.package_name }}.${NUMBER}.vvppp"
606
+ done
607
+
608
+ # Rename to artifact.vvpp if there are only artifact.001.vvppp
609
+ if [ "$(find ${{ steps.vars.outputs.package_name }}.*.vvppp -maxdepth 1 | wc -l)" == 1 ]; then
610
+ mv ${{ steps.vars.outputs.package_name }}.001.vvppp ${{ steps.vars.outputs.package_name }}.vvpp
611
+ fi
612
+
613
+ # Output splitted archive list
614
+ ls ${{ steps.vars.outputs.package_name }}*.vvppp ${{ steps.vars.outputs.package_name }}.vvpp > archives_vvpp.txt || true
615
+ mv archives_vvpp.txt "${{ steps.vars.outputs.package_name }}.vvpp.txt"
616
+
617
+ - name: <Deploy> Upload VVPP archives to artifact
618
+ if: github.event.inputs.upload_artifact == 'true'
619
+ uses: actions/upload-artifact@v4
620
+ with:
621
+ name: ${{ steps.vars.outputs.package_name }}-vvpp
622
+ path: |
623
+ ${{ steps.vars.outputs.package_name }}.vvpp
624
+ ${{ steps.vars.outputs.package_name }}*.vvppp
625
+ ${{ steps.vars.outputs.package_name }}.vvpp.txt
626
+
627
+ - name: <Deploy> Upload VVPP archives to Release assets
628
+ if: needs.config.outputs.version != ''
629
+ uses: ncipollo/release-action@v1
630
+ with:
631
+ allowUpdates: true
632
+ prerelease: ${{ github.event.inputs.prerelease }}
633
+ token: ${{ secrets.GITHUB_TOKEN }}
634
+ tag: ${{ needs.config.outputs.version }}
635
+ artifacts: >
636
+ ${{ steps.vars.outputs.package_name }}.vvpp,
637
+ ${{ steps.vars.outputs.package_name }}*.vvppp,
638
+ ${{ steps.vars.outputs.package_name }}.vvpp.txt
639
+ commit: ${{ github.sha }}
640
+
641
+ - name: <Deploy> Merge artifacts
642
+ if: github.event.inputs.upload_artifact == 'true'
643
+ uses: actions/upload-artifact/merge@v4
644
+ with:
645
+ name: ${{ steps.vars.outputs.package_name }}
646
+ pattern: ${{ steps.vars.outputs.package_name }}-*
647
+ delete-merged: true
648
+
649
+ update-tag-to-current-commit:
650
+ if: needs.config.outputs.version != ''
651
+ needs: [config, build-and-upload]
652
+ runs-on: ubuntu-latest
653
+ steps:
654
+ - name: <Setup> Check out the repository
655
+ uses: actions/checkout@v4
656
+
657
+ - name: <Deploy> Change tag to this commit for refreshing the release # c.f. voicevox_engine#854
658
+ run: |
659
+ git tag -f ${{ needs.config.outputs.version }}
660
+ git push -f --tag
661
+
662
+ run-release-test-workflow:
663
+ if: needs.config.outputs.version != ''
664
+ needs: [config, build-and-upload]
665
+ uses: ./.github/workflows/test-engine-package.yml
666
+ with:
667
+ version: ${{ needs.config.outputs.version }}
668
+ repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL
voicevox_engine/.github/workflows/build-latest-dev.yml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Release latest dev build
2
+
3
+ # masterブランチが更新されるたびに開発版をビルドしてデプロイする。
4
+ # バージョン(タグ)は最新リリースのバージョンを`X.Y.Z`としたときの`X.Y+1.0-dev`。
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - master
10
+ paths-ignore:
11
+ - "docs/**"
12
+ - "test/**"
13
+
14
+ jobs:
15
+ latest-dev-build:
16
+ runs-on: ubuntu-latest
17
+ if: github.repository_owner == 'VOICEVOX'
18
+ steps:
19
+ - name: Trigger workflow_dispatch
20
+ uses: actions/github-script@v7
21
+ with:
22
+ github-token: ${{ secrets.GITHUB_TOKEN }}
23
+ script: |
24
+ const latest_release = await github.rest.repos.getLatestRelease({
25
+ owner: context.repo.owner,
26
+ repo: context.repo.repo
27
+ });
28
+ const split_version = latest_release.data.tag_name.split('.');
29
+ const dev_version = `${split_version[0]}.${parseInt(split_version[1]) + 1}.0-dev`;
30
+ github.rest.actions.createWorkflowDispatch({
31
+ owner: context.repo.owner,
32
+ repo: context.repo.repo,
33
+ workflow_id: 'build-engine-package.yml',
34
+ ref: 'master',
35
+ inputs: {
36
+ version: dev_version,
37
+ prerelease: true
38
+ }
39
+ })
40
+ github.rest.actions.createWorkflowDispatch({
41
+ owner: context.repo.owner,
42
+ repo: context.repo.repo,
43
+ workflow_id: 'build-engine-container.yml',
44
+ ref: 'master',
45
+ inputs: {
46
+ version: dev_version
47
+ }
48
+ })
49
+ console.log(`Triggered workflow_dispatch for ${dev_version}`);
voicevox_engine/.github/workflows/test-engine-container.yml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Test Docker Release Build
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ version:
7
+ type: string
8
+ required: true
9
+ repo_url:
10
+ type: string
11
+ required: false
12
+ workflow_dispatch:
13
+ inputs:
14
+ version:
15
+ type: string
16
+ description: "テストしたいタグ名"
17
+ required: true
18
+
19
+ env:
20
+ IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/voicevox_engine
21
+ VERSION: |- # version指定時はversionを、それ以外はタグ名を使用
22
+ ${{ (github.event.inputs || inputs).version }}
23
+
24
+ defaults:
25
+ run:
26
+ shell: bash
27
+
28
+ jobs:
29
+ test:
30
+ runs-on: [ ubuntu-20.04 ]
31
+ strategy:
32
+ fail-fast: false
33
+ matrix:
34
+ tag:
35
+ - ""
36
+ - cpu
37
+ - cpu-ubuntu20.04
38
+
39
+ steps:
40
+ - name: <Setup> Check out the repository
41
+ uses: actions/checkout@v4
42
+
43
+ - name: <Setup> Prepare Python Runtime / Python Dependencies
44
+ uses: ./.github/actions/prepare_python
45
+ with:
46
+ requirements-suffix: "-dev"
47
+
48
+ - name: <Setup> Declare variables
49
+ id: docker_vars
50
+ run: |
51
+ if [ "${{ matrix.tag }}" != "" ]; then
52
+ echo "image_tag=${{ env.IMAGE_NAME }}:${{ matrix.tag }}-${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
53
+ else
54
+ echo "image_tag=${{ env.IMAGE_NAME }}:${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
55
+ fi
56
+
57
+ - name: <Setup> Pull ENGINE application docker image
58
+ run: docker pull "${{ steps.docker_vars.outputs.image_tag }}"
59
+
60
+ - name: <Setup> Run ENGINE application docker container
61
+ run: docker run -d -p 50021:50021 "${{ steps.docker_vars.outputs.image_tag }}"
62
+
63
+ # Docker コンテナが起動してから、レスポンスが返ってくるまで待機する
64
+ # リトライは10回まで `/version` にアクセスしてレスポンスのステータスコードをチェック
65
+ # - ステータスコードが `200` の場合は正常終了します
66
+ # - ステータスコードが `200` 以外の場合は、5秒間スリープしてリトライします
67
+ - name: <Setup> Warm up ENGINE server by waiting
68
+ run: |
69
+ set +e # curlのエラーを無視する
70
+
71
+ url="http://127.0.0.1:50021/version"
72
+ max_attempts=10
73
+ sleep_interval=5
74
+
75
+ for i in $(seq 1 "$max_attempts"); do
76
+ status=$(curl -o /dev/null -s -w '%{http_code}\n' "$url")
77
+ if [ "$status" -eq 200 ]; then
78
+ echo "Container is ready! Response status code: ${status}"
79
+ exit 0
80
+ else
81
+ echo "Attempt ${i}/${max_attempts}: Response status code $status"
82
+ sleep "${sleep_interval}"
83
+ fi
84
+ done
85
+ exit 1
86
+
87
+ - name: <Test> Test ENGINE application docker container
88
+ run: python tools/check_release_build.py --skip_run_process --dist_dir dist/
voicevox_engine/.github/workflows/test-engine-package.yml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Test Release Build
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ version:
7
+ type: string
8
+ required: true
9
+ repo_url:
10
+ type: string
11
+ required: false
12
+ workflow_dispatch:
13
+ inputs:
14
+ version:
15
+ type: string
16
+ description: "テストしたいタグ名"
17
+ required: true
18
+ repo_url:
19
+ type: string
20
+ description: "リポジトリのURL(省略可能)"
21
+ required: false
22
+
23
+ env:
24
+ REPO_URL:
25
+ |- # repo_url指定時はrepo_urlを、それ以外はgithubのリポジトリURLを使用
26
+ ${{ (github.event.inputs || inputs).repo_url || format('{0}/{1}', github.server_url, github.repository) }}
27
+ VERSION: |- # version指定時はversionを、それ以外はタグ名を使用
28
+ ${{ (github.event.inputs || inputs).version }}
29
+
30
+ defaults:
31
+ run:
32
+ shell: bash
33
+
34
+ jobs:
35
+ test:
36
+ strategy:
37
+ fail-fast: false
38
+ matrix:
39
+ include:
40
+ - os: ubuntu-20.04
41
+ target: linux-cpu
42
+ - os: ubuntu-20.04
43
+ target: linux-nvidia
44
+ - os: macos-12
45
+ target: macos-x64
46
+ - os: macos-14
47
+ target: macos-arm64
48
+ - os: windows-2019
49
+ target: windows-cpu
50
+ - os: windows-2019
51
+ target: windows-nvidia
52
+ - os: windows-2019
53
+ target: windows-directml
54
+
55
+ runs-on: ${{ matrix.os }}
56
+
57
+ steps:
58
+ - name: <Setup> Declare variables
59
+ id: vars
60
+ run: |
61
+ echo "release_url=${{ env.REPO_URL }}/releases/download/${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
62
+ echo "package_name=voicevox_engine-${{ matrix.target }}-${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
63
+
64
+ - name: <Setup> Check out the repository
65
+ uses: actions/checkout@v4
66
+
67
+ - name: <Setup> Prepare Python Runtime / Python Dependencies
68
+ uses: ./.github/actions/prepare_python
69
+ with:
70
+ requirements-suffix: "-dev"
71
+
72
+ - name: <Setup> Download ENGINE package
73
+ run: |
74
+ mkdir -p download
75
+ curl -L -o "download/list.txt" "${{ steps.vars.outputs.release_url }}/${{ steps.vars.outputs.package_name }}.7z.txt"
76
+ <download/list.txt xargs -I '%' curl -L -o "download/%" "${{ steps.vars.outputs.release_url }}/%"
77
+ 7z x "download/$(head -n1 download/list.txt)"
78
+ mv "${{ matrix.target }}" dist/
79
+
80
+ - name: <Setup> Set up permission
81
+ if: startsWith(matrix.target, 'linux') || startsWith(matrix.target, 'macos')
82
+ run: chmod +x dist/run
83
+
84
+ - name: <Test> Test ENGINE package
85
+ run: python tools/check_release_build.py --dist_dir dist/
voicevox_engine/.github/workflows/test-issue-freshness.yml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Github Issue が停滞状態になっていないか確認する
2
+
3
+ name: "Test issue freshness"
4
+ on:
5
+ schedule:
6
+ - cron: "0 3 * * *"
7
+ workflow_dispatch:
8
+ inputs:
9
+ dryrun:
10
+ type: boolean
11
+ required: true
12
+ description: "ドライランする"
13
+ jobs:
14
+ stale:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: <Test> Notify inactive 必要性議論 issues
18
+ uses: actions/stale@v9
19
+ with:
20
+ # on.schedule で起動した場合は `inputs.dryrun == null` であるため `debug-only: false` となる
21
+ debug-only: ${{ inputs.dryrun == 'true' }}
22
+ any-of-labels: "状態:必要性議論"
23
+ days-before-stale: 30
24
+ days-before-close: -1
25
+ stale-issue-message: "本 Issue は直近 30 日間で活動がありません。今後の方針について VOICEVOX チームによる再検討がおこなわれる予定です。"
26
+ stale-issue-label: "非アクティブ"
27
+
28
+ - name: <Test> Notify inactive 設計/実装者募集/実装 issues
29
+ uses: actions/stale@v9
30
+ with:
31
+ # on.schedule で起動した場合は `inputs.dryrun == null` であるため `debug-only: false` となる
32
+ debug-only: ${{ inputs.dryrun == 'true' }}
33
+ any-of-labels: "状態:設計,状態:実装者募集,状態:実装"
34
+ days-before-stale: 180
35
+ days-before-close: -1
36
+ stale-issue-message: "本 Issue は直近 180 日間で活動がありません。今後の方針について VOICEVOX チームによる再検討がおこなわれる予定です。"
37
+ stale-issue-label: "非アクティブ"
voicevox_engine/.github/workflows/test-security.yml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python 依存パッケージの脆弱性診断を定期的に行う
2
+ # NOTE: 公式 Action は API key 等を必要とするため利用しない(https://github.com/pyupio/safety-action/tree/main)
3
+
4
+ name: test-security
5
+
6
+ on:
7
+ schedule:
8
+ - cron: "00 04 15 * *" # 毎月15日 13:00 JST
9
+
10
+ defaults:
11
+ run:
12
+ shell: bash
13
+
14
+ jobs:
15
+ test-security:
16
+ runs-on: ubuntu-20.04
17
+ steps:
18
+ - name: <Setup> Check out the repository
19
+ uses: actions/checkout@v4
20
+
21
+ - name: <Setup> Prepare Python Runtime / Python Dependencies
22
+ uses: ./.github/actions/prepare_python
23
+ with:
24
+ requirements-suffix: "-dev"
25
+
26
+ - name: <Test> Check Python dependency security
27
+ run: safety check -r requirements.txt -r requirements-dev.txt -r requirements-build.txt -o bare
28
+
29
+ - name: <Deploy> Notify Discord of security testing result
30
+ uses: sarisia/actions-status-discord@v1
31
+ if: always()
32
+ with:
33
+ webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
34
+ username: GitHub Actions
35
+ title: "依存パッケージ脆弱性診断の結果"
36
+ status: ${{ job.status }}
37
+ color: ${{ job.status == 'success' && '0x00FF00' || '0xFF0000' }}
38
+ url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
39
+
voicevox_engine/.github/workflows/test.yml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ defaults:
9
+ run:
10
+ shell: bash
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ matrix:
17
+ os: [ubuntu-20.04, macos-latest, windows-latest]
18
+
19
+ steps:
20
+ - name: <Setup> Check out the repository
21
+ uses: actions/checkout@v4
22
+
23
+ - name: <Setup> Prepare Python Runtime / Python Dependencies
24
+ uses: ./.github/actions/prepare_python
25
+ with:
26
+ requirements-suffix: "-dev"
27
+
28
+ - name: <Test> Validate poetry.lock
29
+ run: |
30
+ poetry lock --no-update
31
+ git diff --exit-code
32
+
33
+ - name: <Test> Check dependency lists
34
+ run: |
35
+ poetry export --without-hashes -o requirements.txt.check
36
+ poetry export --without-hashes --with dev -o requirements-dev.txt.check
37
+ poetry export --without-hashes --with build -o requirements-build.txt.check
38
+
39
+ diff -q requirements.txt requirements.txt.check || \
40
+ diff -q requirements-dev.txt requirements-dev.txt.check || \
41
+ diff -q requirements-build.txt requirements-build.txt.check > /dev/null
42
+ if [ $? = 1 ]; then
43
+ echo "poetry export has some diff"
44
+ exit 1
45
+ fi
46
+
47
+ - name: <Test> Check format
48
+ run: pysen run lint
49
+
50
+ - name: <Test> Test codes and coverage
51
+ run: coverage run --omit=test/* -m pytest
52
+
53
+ - name: <Deploy> Submit coverage results to Coveralls
54
+ if: matrix.os == 'ubuntu-20.04'
55
+ run: coveralls --service=github
56
+ env:
57
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+
59
+ - name: <Test> Check licenses
60
+ run: OUTPUT_LICENSE_JSON_PATH=/dev/null bash tools/create_venv_and_generate_licenses.bash
61
+
62
+ - name: <Test> Test names by checking typo
63
+ if: matrix.os == 'ubuntu-20.04'
64
+ uses: crate-ci/typos@v1.21.0
65
+
66
+ lint-builders:
67
+ runs-on: ubuntu-20.04
68
+ steps:
69
+ - name: <Setup> Check out the repository
70
+ uses: actions/checkout@v4
71
+
72
+ - name: <Setup> Install ShellCheck
73
+ run: |
74
+ sudo apt-get update
75
+ sudo apt-get install -y shellcheck
76
+
77
+ - name: <Test> Check shell files
78
+ run: git ls-files | grep -E '\.(ba)?sh' | xargs shellcheck
79
+
80
+ - name: <Test> Check workflow files
81
+ run: |
82
+ bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
83
+ ./actionlint
voicevox_engine/.gitignore ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VOICEVOX specifics
2
+ ## Artifact of generating licenses
3
+ /licenses.json
4
+ licenses_venv/
5
+
6
+ # Copied from `https://github.com/github/gitignore/blob/main/Python.gitignore` @2022-01-10
7
+ # Byte-compiled / optimized / DLL files
8
+ __pycache__/
9
+ *.py[cod]
10
+ *$py.class
11
+
12
+ # C extensions
13
+ *.so
14
+
15
+ # Distribution / packaging
16
+ .Python
17
+ build/
18
+ develop-eggs/
19
+ dist/
20
+ downloads/
21
+ eggs/
22
+ .eggs/
23
+ lib/
24
+ lib64/
25
+ parts/
26
+ sdist/
27
+ var/
28
+ wheels/
29
+ share/python-wheels/
30
+ *.egg-info/
31
+ .installed.cfg
32
+ *.egg
33
+ MANIFEST
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ # poetry.lock
103
+
104
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
105
+ __pypackages__/
106
+
107
+ # Celery stuff
108
+ celerybeat-schedule
109
+ celerybeat.pid
110
+
111
+ # SageMath parsed files
112
+ *.sage.py
113
+
114
+ # Environments
115
+ .env
116
+ .venv
117
+ env/
118
+ venv/
119
+ ENV/
120
+ env.bak/
121
+ venv.bak/
122
+
123
+ # Spyder project settings
124
+ .spyderproject
125
+ .spyproject
126
+
127
+ # Rope project settings
128
+ .ropeproject
129
+
130
+ # mkdocs documentation
131
+ /site
132
+
133
+ # mypy
134
+ .mypy_cache/
135
+ .dmypy.json
136
+ dmypy.json
137
+
138
+ # Pyre type checker
139
+ .pyre/
140
+
141
+ # pytype static type analyzer
142
+ .pytype/
143
+
144
+ # Cython debug symbols
145
+ cython_debug/
146
+
147
+ # PyCharm
148
+ # JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
149
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
150
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
151
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
152
+ .idea/
voicevox_engine/.pre-commit-config.yaml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: local
5
+ hooks:
6
+ - id: pysen-lint
7
+ name: pysen-lint
8
+ entry: pysen run lint
9
+ language: python
10
+ types: [file, python]
11
+ stages: [push]
12
+ pass_filenames: false
13
+ - id: poetry-check # `pyproject.toml` と `poetry.lock` が整合する
14
+ name: poetry-check
15
+ entry: poetry check
16
+ language: python
17
+ stages: [push]
18
+ pass_filenames: false
19
+ - id: poetry-export
20
+ name: poetry-export
21
+ entry: poetry export --without-hashes -o requirements.txt
22
+ language: python
23
+ stages: [push]
24
+ pass_filenames: false
25
+ - id: poetry-export-dev
26
+ name: poetry-export-dev
27
+ entry: poetry export --without-hashes --with dev -o requirements-dev.txt
28
+ language: python
29
+ stages: [push]
30
+ pass_filenames: false
31
+ - id: poetry-export-build
32
+ name: poetry-export-build
33
+ entry: poetry export --without-hashes --with build -o requirements-build.txt
34
+ language: python
35
+ stages: [push]
36
+ pass_filenames: false
voicevox_engine/CONTRIBUTING.md ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 貢献者ガイド
2
+
3
+ VOICEVOX ENGINE はオープンソースプロジェクトです。本プロジェクトは活発に開発されており、その成果は製品版 VOICEVOX へも反映されています。VOICEVOX ENGINE はコミュニティの皆さんからのコントリビューションを歓迎しています。
4
+ 本ガイドは開発方針・プルリクエスト手順・レビュープロセスなど、コントリビュータの皆さんの一助となる情報を提供します。
5
+
6
+ ## 目次
7
+
8
+ VOICEVOX ENGINE の方針に関するガイドは以下から確認できます。
9
+
10
+ - [開発ガバナンス](#開発ガバナンス)
11
+ - [バージョニング](#バージョニング)
12
+ - [ブランチ戦略](#ブランチ戦略)
13
+ - [プルリクエスト](#プルリクエスト)
14
+ - [レビュー](#レビュー)
15
+ - [バグ](#バグ)
16
+ - [機能向上](#機能向上)
17
+ - [静的解析](#静的解析)
18
+ - [テスト](#テスト)
19
+ - [ライセンス](#ライセンス)
20
+
21
+ コントリビュータの目的に応じたガイドは以下から確認できます。
22
+
23
+ - [プルリクエストを送る](#プルリクエストを送る)
24
+ - バグ
25
+ - [バグを探す](#バグを探す)
26
+ - [バグを報告する](#バグを報告する)
27
+ - [バグを直す](#バグを直す)
28
+ - 機能向上
29
+ - [機能向上タスクを探す](#機能向上タスクを探す)
30
+ - [機能を要望する](#機能を要望する)
31
+ - [機能を向上させる(実装する)](#機能を向上させる実装する)
32
+ - [環境構築](#環境構築)
33
+ - [コード実行](#コード実行)
34
+
35
+ 開発にあたって頻繁に利用されるコマンドは以下から確認できます。
36
+
37
+ - [依存ライブラリをインストールする](#依存ライブラリをインストールする)
38
+ - [音声ライブラリ無しで実行](#音声ライブラリ無しで実行)
39
+ - パッケージ
40
+ - [パッケージを追加する](#パッケージを追加する)
41
+ - [パッケージを更新する](#パッケージを更新する)
42
+ - [パッケージ情報を pip requirements.txt ファイルへ反映する](#パッケージ情報を-pip-requirementstxt-ファイルへ反映する)
43
+ - 静的解析
44
+ - [タイポを検査する](#タイポを検査する)
45
+ - [静的解析を一括実行する](#静的解析を一括実行する)
46
+ - テスト
47
+ - [コードをテストする](#コードをテストする)
48
+ - [スナップショットを更新する](#スナップショットを更新する)
49
+ - [脆弱性を診断する](#脆弱性を診断する)
50
+
51
+ ## 開発ガバナンス
52
+
53
+ VOICEVOX ENGINE は GitHub ベースのオープンな開発をおこなっています。
54
+ コミュニティの皆さんからの機能要望・バグ報告・質問を GitHub Issues で受け付けています。またプルリクエストも歓迎しています。Issue を解決するプルリクエストを作成される際は、別の方と同じ Issue に取り組むことを避けるため、Issue 側で取り組み始めたことを伝えるか、最初に Draft プルリクエストを作成することを推奨しています。
55
+
56
+ より気軽な開発を可能にする目的で、[VOICEVOX 非公式 Discord サーバー](https://discord.gg/WMwWetrzuh)にて開発の議論や雑談を行っています。気軽にご参加ください。
57
+
58
+ ## バージョニング
59
+
60
+ セマンティックバージョニングを採用しています。
61
+ 現段階ではメジャーバージョンが 0 であり、破壊的変更を含むマイナーアップデートを許容しています。大きな機能追加・変更ではマイナーバージョンを、バグ修正やキャラクター追加ではパッチバージョンを更新しています。
62
+
63
+ 変更内容の概要は各バージョンの [Releases](https://github.com/VOICEVOX/voicevox_engine/releases) にて確認できます。
64
+
65
+ ## ブランチ戦略
66
+
67
+ ブランチ戦略としてリリースブランチ付き GitHub Flow を採用しています。
68
+ プルリクエストは基本的に `master` ブランチへマージされます。例外として製品版 VOICEVOX の更新時期にはリリースブランチ `release-X.Y` が用意され、一時的に `master` から分岐します。リリースに必要なコミットが `release-X.Y` へおこなわれ、このブランチからリリースがおこなわれます。リリース直後の hotfix 等は `release-X.Y` に対してまずマージされ、リリースの後にブランチごと `master` へマージされます。
69
+
70
+ ## プルリクエスト
71
+
72
+ 全てのコード変更はプルリクエストを介しておこなわれます。
73
+ プルリクエストは [GitHub Pull requests](https://github.com/VOICEVOX/voicevox_engine/pulls) で一括管理され、[レビュー](#レビュー)を経てマージされます。VOICEVOX ENGINE はコミュニティの皆さんからのプルリクエストを歓迎しています。
74
+
75
+ ### プルリクエストを送る
76
+
77
+ 以下の手順でプルリクエストを���成できます。
78
+
79
+ - [開発環境](#環境構築)を用意する
80
+ - このレポジトリをフォークし、`master` ブランチからプルリクエスト用ブランチを作る
81
+ - [依存ライブラリをインストールする](#依存ライブラリをインストールする)
82
+ - (任意)[音声ライブラリを導入する](#音声ライブラリを導入する)
83
+ - [コードを編集する](#コードを編集する)
84
+ - [静的解析を一括実行する](#静的解析を一括実行する)([型検査](#型検査)・[リント](#リント)・[整形](#整形))
85
+ - [コードをテストする](#コードをテストする)
86
+ - ブランチをリモートへプッシュし、このレポジトリに対してプルリクエストを作成する
87
+
88
+ ## レビュー
89
+
90
+ 全てのプルリクエストはレビューを経てマージされます。
91
+ レビューは [GitHub Pull requests](https://github.com/VOICEVOX/voicevox_engine/pulls) 上でオープンにおこなわれ、コミュニティの誰でもコメント等の形で参加可能です。レビューを経たのちに `master` (あるいは `release-X.Y`) ブランチへマージされます。マージには VOICEVOX チームによる approve が必須です。
92
+
93
+ ## バグ
94
+
95
+ GitHub Issues を用いてバグを一元管理しています。
96
+
97
+ ### バグを探す
98
+
99
+ [`バグ` ラベルでのフィルタリング](https://github.com/VOICEVOX/voicevox_engine/issues?q=is%3Aissue+is%3Aopen+label%3Aバグ)により既知バグの一覧にアクセスできます。バグの修正状況は各バグの issue にて確認できます。
100
+
101
+ ### バグを報告する
102
+
103
+ 既知バグの一覧にないバグ(新規バグ)を見つけた場合、GitHub Issues で報告が可能です。VOICEVOX ENGINE は新規バグの報告を歓迎しています。
104
+
105
+ ### バグを直す
106
+
107
+ バグの修正は Issue 上で議論され、プルリクエストを用いて修正されます。プルリクエストを作成する手順は "[プルリクエストを送る](#プルリクエストを送る)" でガイドされています。VOICEVOX ENGINE はバグを修正するプルリクエストを歓迎しています。
108
+
109
+ ## 機能向上
110
+
111
+ GitHub Issues を用いて機能向上を一元管理しています。
112
+
113
+ ### 機能向上タスクを探す
114
+
115
+ [`機能向上` ラベルでのフィルタリング](https://github.com/VOICEVOX/voicevox_engine/issues?q=is%3Aissue+is%3Aopen+label%3A機能向上)により新規機能追加や仕様変更の一覧にアクセスできます。機能向上の実装状況は各機能向上の issue にて確認できます。
116
+
117
+ ### 機能を要望する
118
+
119
+ 既存提案一覧にない機能向上案がある場合、GitHub Issues で提案が可能です。VOICEVOX ENGINE は機能向上の提案を歓迎しています。
120
+
121
+ ### 機能を向上させる(実装する)
122
+
123
+ 機能向上は Issue 上で議論され、プルリクエストを用いて実装されます。プルリクエストを作成する手順は "[プルリクエストを送る](#プルリクエストを送る)" でガイドされています。VOICEVOX ENGINE は機能向上を実装するプルリクエストを歓迎しています。
124
+
125
+ ## 環境構築
126
+
127
+ `Python 3.11.3` を用いて開発されています。
128
+ インストールするには、各 OS ごとの C/C++ コンパイラ、CMake が必要になります。
129
+
130
+ ### 依存ライブラリをインストールする
131
+
132
+ シェルで以下のコマンドを実行することで依存ライブラリがインストールされます。
133
+
134
+ ```bash
135
+ # 実行・開発・テスト環境のインストール
136
+ python -m pip install -r requirements.txt -r requirements-dev.txt -r requirements-build.txt
137
+
138
+ # git hook のインストール
139
+ pre-commit install -t pre-push
140
+ ```
141
+
142
+ ## 音声ライブラリ
143
+
144
+ OSS 版 VOICEVOX ENGINE は製品版 VOICEVOX の音声ライブラリを同梱していないため、音声合成がモック版となっています。
145
+
146
+ 製品版 VOICEVOX の音声ライブラリは、利用規約を遵守の上、以下のいずれかの手順で導入できます。これにより「ずんだもん」等の製品版キャラクター音声を合成できます。
147
+
148
+ ### 音声ライブラリを導入する
149
+
150
+ 音声ライブラリは以下のいずれかの手順で導入できます。
151
+
152
+ #### 製品版 VOICEVOX を用いた音声ライブラリの導入
153
+
154
+ 製品版 VOICEVOX を導入することで音声ライブラリを利用できます。
155
+ [VOICEVOX 公式ホームページ](https://voicevox.hiroshiba.jp/)に従いソフトウェアを導入してください。
156
+
157
+ #### 製品版 VOICEVOX CORE を用いた音声ライブラリの導入
158
+
159
+ 製品版 VOICEVOX CORE を導入することで音声ライブラリを利用できます。
160
+ 以下のコマンドにより必要なファイルが準備されます。
161
+
162
+ ```bash
163
+ # CORE のバリエーション指定変数を定義する(例として x64 Linux マシン向け VOICEVOX CORE v0.15.0 CPU版)
164
+ VERSION="0.15.0"; OS="linux"; ARCHITECTURE="x64"; PROCESSOR="cpu";
165
+
166
+ # CORE をダウンロード・展開する
167
+ CORENAME="voicevox_core-${OS}-${ARCHITECTURE}-${PROCESSOR}-${VERSION}"
168
+ curl -L "https://github.com/VOICEVOX/voicevox_core/releases/download/${VERSION}/${CORENAME}.zip" -o "${CORENAME}.zip"
169
+ unzip "${CORENAME}.zip"
170
+ ```
171
+
172
+ CORE のバリエーション変数は以下の値を指定できます。
173
+
174
+ - `VERSION`: voicevox_core のバージョン (例として `0.15.0`)
175
+ - `OS`: OS 種別 (`windows` | `osx` | `linux`)
176
+ - `ARCHITECTURE`: CPU アーキテクチャ (`x86` | `x64` | `arm64`)
177
+ - `PROCESSOR`: プロセッサ種別 (`cpu` | `gpu` | `cuda` | `directml`)
178
+
179
+ 最新のリリースは[こちら](https://github.com/VOICEVOX/voicevox_core/releases/latest)にあります。
180
+
181
+ ## コード実行
182
+
183
+ VOICEVOX ENGINE を実行することで HTTP サーバーが立ち上がります。
184
+ コマンドライン引数の詳細は以下のコマンドで確認してください。
185
+
186
+ ```bash
187
+ python run.py --help
188
+ ```
189
+
190
+ ### 音声ライブラリ無しで実行
191
+
192
+ 音声ライブラリを導入しなかった場合あるいは軽量のモック版音声合成を利用したい場合、シェルで以下のコマンドを実行することでエンジンが実行されます。
193
+
194
+ ```bash
195
+ python run.py --enable_mock
196
+ ```
197
+
198
+ ### 音声ライブラリに製品版 VOICEVOX を利用して実行
199
+
200
+ ```bash
201
+ VOICEVOX_DIR="C:/path/to/VOICEVOX/vv-engine" # 製品版 VOICEVOX ディレクトリ内の ENGINE のパス
202
+ python run.py --voicevox_dir=$VOICEVOX_DIR
203
+ ```
204
+
205
+ ### 音声ライブラリに製品版 VOICEVOX CORE を利用して実行
206
+
207
+ ```bash
208
+ VOICELIB_DIR_1="C:/path/to/core_1"; VOICELIB_DIR_2="C:/path/to/core_2"; # 製品版 VOICEVOX CORE ディレクトリのパス
209
+ python run.py --voicelib_dir=$VOICELIB_DIR_1 --voicelib_dir=$VOICELIB_DIR_2
210
+ ```
211
+
212
+ ### ログを UTF8 に変更
213
+
214
+ ```bash
215
+ python run.py --output_log_utf8
216
+ # もしくは
217
+ VV_OUTPUT_LOG_UTF8=1 python run.py
218
+ ```
219
+
220
+ ## コードを編集する
221
+
222
+ ### パッケージ
223
+
224
+ `poetry` によってパッケージを管理しています。また `pip` ユーザー向けに `requirements-*.txt` を生成しています。
225
+ 依存パッケージは「ビルドにより音声ライブラリと一体化しても、音声ライブラリのライセンスと衝突しない」ライセンスを持つ必要があります。
226
+ 主要ライセンスの可否は以下の通りです。
227
+
228
+ - MIT/Apache/BSD-3: OK
229
+ - LGPL: OK (コアと動的分離されているため)
230
+ - GPL: NG (全関連コードの公開が必要なため)
231
+
232
+ #### パッケージを追加する
233
+
234
+ ```bash
235
+ poetry add `パッケージ名`
236
+ poetry add --group dev `パッケージ名` # 開発依存の追加
237
+ poetry add --group build `パッケージ名` # ビルド依存の追加
238
+ ```
239
+
240
+ #### パッケージを更新する
241
+
242
+ ```bash
243
+ poetry update `パッケージ名`
244
+ poetry update # 全部更新
245
+ ```
246
+
247
+ #### パッケージ情報を pip requirements.txt ファイルへ反映する
248
+
249
+ ```bash
250
+ poetry export --without-hashes -o requirements.txt # こちらを更新する場合は下3つも更新する必要があります。
251
+ poetry export --without-hashes --with dev -o requirements-dev.txt
252
+ poetry export --without-hashes --with build -o requirements-build.txt
253
+ ```
254
+
255
+ ## 静的解析
256
+
257
+ ### 型検査
258
+
259
+ 型検査を採用しています。
260
+ 目的は安全性の向上であり、チェッカーには `mypy` を採用しています。
261
+
262
+ 型検査の実行は "[静的解析を一括実行する](#静的解析を一括実行する)" 節を参照してください。
263
+
264
+ ### リント
265
+
266
+ 自動リントを採用しています。
267
+ 目的は安全性の向上であり、リンターには `flake8` と `isort` を採用しています。
268
+
269
+ リンターの実行は "[静的解析を一括実行する](#静的解析を一括実行する)" 節を参照してください。
270
+
271
+ ### 整形
272
+
273
+ コード自動整形を採用しています。
274
+ 目的は可読性の向上であり、フォーマッタには `black` を採用しています。
275
+
276
+ フォーマッタの実行は "[静的解析を一括実行する](#静的解析を一括実行する)" 節を参照してください。
277
+
278
+ なお、ドキュメント自動整形は現段階では採用していません。メンテナが定期的に `prettier` で整形しています。
279
+
280
+ ### タイポ検査
281
+
282
+ タイポ検査を採用しています。
283
+ 目的は可読性の向上であり、チェッカーには [`typos`](https://github.com/crate-ci/typos) を採用しています。誤判定やチェックから除外すべきファイルがあれば[設定ファイルの説明](https://github.com/crate-ci/typos#false-positives)に従って `pyproject.toml` を編集してください。
284
+ ローカルへの `typos` 導入は各自の環境に合わせて公式ドキュメントを参照してください。ローカルへの導入が難しい場合、プルリクエスト時に GitHub Actions で自動実行される `typos` の結果を参照してください。
285
+
286
+ #### タイポを検査する
287
+
288
+ シェルで以下のコマンドを実行することでタイポが検査されます。
289
+
290
+ ```bash
291
+ typos
292
+ ```
293
+
294
+ ### 静的解析を一括実行する
295
+
296
+ シェルで以下のコマンドを実行することで静的解析([型検査](#型検査)・[リント](#リント)・[整形](#整形))が一括実行されます。
297
+ この際、可能な範囲で自動修正がおこなわれます。
298
+
299
+ ```bash
300
+ pysen run format lint
301
+ ```
302
+
303
+ ## テスト
304
+
305
+ 自動テストを採用しています。
306
+ 長期的に安定した開発を目指して単体テスト・End-to-End テスト共に充実させており、値の不変を保証するスナップショットテストも採用しています。テストランナーには `pytest` を採用しています。
307
+
308
+ ### コードをテストする
309
+
310
+ シェルで以下のコマンドを実行することでテストが走ります。
311
+
312
+ ```bash
313
+ python -m pytest
314
+ ```
315
+
316
+ ### スナップショットを更新する
317
+
318
+ コード変更により想定される出力値が変わり、スナップショットの更新が必要となる場合があります。
319
+ シェルで以下のコマンドを実行することでスナップショットが更新されます。
320
+
321
+ ```bash
322
+ python -m pytest --snapshot-update
323
+ ```
324
+
325
+ ### 脆弱性を診断する
326
+
327
+ `safety` を用いた脆弱性診断により依存パッケージの安全性を確保しています。
328
+ シェルで以下のコマンドを実行することで脆弱性が診断されます。
329
+
330
+ ```bash
331
+ safety check -r requirements.txt -r requirements-dev.txt -r requirements-build.txt
332
+ ```
333
+
334
+ ## ビルド
335
+
336
+ この方法でビルドしたものは、リリースで公開されているものとは異なります。 また、GPU で利用するには cuDNN や CUDA、DirectML などのライブラリが追加で必要となります。
337
+
338
+ ```bash
339
+ OUTPUT_LICENSE_JSON_PATH=licenses.json \
340
+ bash tools/create_venv_and_generate_licenses.bash
341
+
342
+ # モックでビルドする場合
343
+ pyinstaller --noconfirm run.spec
344
+
345
+ # 製品版でビルドする場合
346
+ CORE_MODEL_DIR_PATH="/path/to/core_model" \
347
+ LIBCORE_PATH="/path/to/libcore" \
348
+ LIBONNXRUNTIME_PATH="/path/to/libonnxruntime" \
349
+ pyinstaller --noconfirm run.spec
350
+ ```
351
+
352
+ TODO: Docker 版のビルド手順を GitHub Actions をベースに記述する
353
+
354
+ ### Github Actions でビルド
355
+
356
+ fork したリポジトリで Actions を ON にし、workflow_dispatch で`build-engine-package.yml`を起動すればビルドできます。
357
+ 成果物は Release にアップロードされます。
358
+
359
+ ### API ドキュメントの確認
360
+
361
+ [API ドキュメント](https://voicevox.github.io/voicevox_engine/api/)(実体は`docs/api/index.html`)は自動で更新されます。
362
+ 次のコマンドで API ドキュメントを手動で作成することができます。
363
+
364
+ ```bash
365
+ PYTHONPATH=. python tools/make_docs.py
366
+ ```
367
+
368
+ ## GitHub Actions
369
+
370
+ ### Variables
371
+
372
+ | name | description |
373
+ | :----------------- | :------------------ |
374
+ | DOCKERHUB_USERNAME | Docker Hub ユーザ名 |
375
+
376
+ ### Secrets
377
+
378
+ | name | description |
379
+ | :-------------- | :---------------------------------------------------------------------- |
380
+ | DOCKERHUB_TOKEN | [Docker Hub アクセストークン](https://hub.docker.com/settings/security) |
381
+
382
+ ## Issue
383
+
384
+ 不具合の報告、機能要望、改善提案、質問は<a href="https://github.com/VOICEVOX/voicevox_engine/issues/new">Issue</a>の方に報告してください。
385
+
386
+ ### Issue の状態
387
+
388
+ VOICEVOX ENGINE では issue の状態遷移を以下のように整理しています。
389
+ 各状態は GitHub の `状態:〇〇` ラベルと対応しています(例: [`状態:実装者募集`](https://github.com/VOICEVOX/voicevox_engine/labels/状態:実装者募集))。
390
+
391
+ ```mermaid
392
+ ---
393
+ title: issue 状態遷移図 v1.0
394
+ ---
395
+ stateDiagram-v2
396
+ [*] --> 必要性議論 : issue open
397
+ state opened {
398
+ 必要性議論 --> 設計
399
+ 設計 --> 実装者募集
400
+ 実装者募集 --> 実装 : 着手宣言
401
+ }
402
+ opened --> not_planned : NoGo 判断
403
+ not_planned --> [*] : issue close
404
+ 実装 --> resolved : Pull request merge
405
+ resolved --> [*] : issue close
406
+ opened --> ロードマップ : 停滞
407
+ ロードマップ --> opened
408
+ ```
409
+
410
+ NOTE: ロードマップ化すべきかの棚卸し判定は、issue が `必要性議論` で 30 日、`設計`・`実装者募集`・`実装` で 180 日停滞した場合におこなう。`実装` の停滞時にはサポートも検討する。
411
+
412
+ ## ライセンス
413
+
414
+ LGPL v3 と、ソースコードの公開が不要な別ライセンスのデュアルライセンスです。
415
+ 別ライセンスを取得したい場合は、ヒホに求めてください。
416
+ X アカウント: [@hiho_karuta](https://x.com/hiho_karuta)
voicevox_engine/Dockerfile ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1.4
2
+
3
+ # TODO: build-arg と target のドキュメントをこのファイルに書く
4
+
5
+ ARG BASE_IMAGE=ubuntu:20.04
6
+ ARG BASE_RUNTIME_IMAGE=$BASE_IMAGE
7
+
8
+ # Download VOICEVOX Core shared object
9
+ FROM ${BASE_IMAGE} AS download-core-env
10
+ ARG DEBIAN_FRONTEND=noninteractive
11
+
12
+ WORKDIR /work
13
+
14
+ RUN <<EOF
15
+ set -eux
16
+
17
+ apt-get update
18
+ apt-get install -y \
19
+ wget \
20
+ unzip
21
+ apt-get clean
22
+ rm -rf /var/lib/apt/lists/*
23
+ EOF
24
+
25
+ # assert VOICEVOX_CORE_VERSION >= 0.11.0 (ONNX)
26
+ ARG TARGETPLATFORM
27
+ ARG USE_GPU=false
28
+ ARG VOICEVOX_CORE_VERSION=0.15.4
29
+
30
+ RUN <<EOF
31
+ set -eux
32
+
33
+ # Processing Switch
34
+ if [ "${USE_GPU}" = "true" ]; then
35
+ VOICEVOX_CORE_ASSET_ASSET_PROCESSING="gpu"
36
+ else
37
+ VOICEVOX_CORE_ASSET_ASSET_PROCESSING="cpu"
38
+ fi
39
+
40
+ # TARGETARCH Switch
41
+ if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then
42
+ VOICEVOX_CORE_ASSET_TARGETARCH="x64"
43
+ else
44
+ VOICEVOX_CORE_ASSET_TARGETARCH="arm64"
45
+ fi
46
+
47
+ VOICEVOX_CORE_ASSET_PREFIX="voicevox_core-linux-${VOICEVOX_CORE_ASSET_TARGETARCH}-${VOICEVOX_CORE_ASSET_ASSET_PROCESSING}"
48
+
49
+ # Download Core
50
+ VOICEVOX_CORE_ASSET_NAME=${VOICEVOX_CORE_ASSET_PREFIX}-${VOICEVOX_CORE_VERSION}
51
+ wget -nv --show-progress -c -O "./${VOICEVOX_CORE_ASSET_NAME}.zip" "https://github.com/VOICEVOX/voicevox_core/releases/download/${VOICEVOX_CORE_VERSION}/${VOICEVOX_CORE_ASSET_NAME}.zip"
52
+ unzip "./${VOICEVOX_CORE_ASSET_NAME}.zip"
53
+ mkdir -p core
54
+ mv "${VOICEVOX_CORE_ASSET_NAME}"/* core
55
+ rm -rf $VOICEVOX_CORE_ASSET_NAME
56
+ rm "./${VOICEVOX_CORE_ASSET_NAME}.zip"
57
+
58
+ # Move Core to /opt/voicevox_core/
59
+ mkdir /opt/voicevox_core
60
+ mv ./core/* /opt/voicevox_core/
61
+
62
+ # Add /opt/voicevox_core to dynamic library search path
63
+ echo "/opt/voicevox_core" > /etc/ld.so.conf.d/voicevox_core.conf
64
+
65
+ # Update dynamic library search cache
66
+ ldconfig
67
+ EOF
68
+
69
+
70
+ # Download ONNX Runtime
71
+ FROM ${BASE_IMAGE} AS download-onnxruntime-env
72
+ ARG DEBIAN_FRONTEND=noninteractive
73
+
74
+ WORKDIR /work
75
+
76
+ RUN <<EOF
77
+ set -eux
78
+
79
+ apt-get update
80
+ apt-get install -y \
81
+ wget \
82
+ tar
83
+ apt-get clean
84
+ rm -rf /var/lib/apt/lists/*
85
+ EOF
86
+
87
+ ARG TARGETPLATFORM
88
+ ARG USE_GPU=false
89
+ ARG ONNXRUNTIME_VERSION=1.13.1
90
+ RUN <<EOF
91
+ set -eux
92
+
93
+ # Processing Switch
94
+ if [ "${USE_GPU}" = "true" ]; then
95
+ ONNXRUNTIME_PROCESSING="gpu-"
96
+ else
97
+ ONNXRUNTIME_PROCESSING=""
98
+ fi
99
+
100
+ # TARGETARCH Switch
101
+ if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then
102
+ ONNXRUNTIME_TARGETARCH=x64
103
+ else
104
+ ONNXRUNTIME_TARGETARCH=aarch64
105
+ fi
106
+
107
+ ONNXRUNTIME_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-${ONNXRUNTIME_TARGETARCH}-${ONNXRUNTIME_PROCESSING}${ONNXRUNTIME_VERSION}.tgz"
108
+
109
+ # Download ONNX Runtime
110
+ wget -nv --show-progress -c -O "./onnxruntime.tgz" "${ONNXRUNTIME_URL}"
111
+
112
+ # Extract ONNX Runtime to /opt/onnxruntime
113
+ mkdir -p /opt/onnxruntime
114
+ tar xf "./onnxruntime.tgz" -C "/opt/onnxruntime" --strip-components 1
115
+ rm ./onnxruntime.tgz
116
+
117
+ # Add /opt/onnxruntime/lib to dynamic library search path
118
+ echo "/opt/onnxruntime/lib" > /etc/ld.so.conf.d/onnxruntime.conf
119
+
120
+ # Update dynamic library search cache
121
+ ldconfig
122
+ EOF
123
+
124
+
125
+ # Compile Python (version locked)
126
+ FROM ${BASE_IMAGE} AS compile-python-env
127
+
128
+ ARG DEBIAN_FRONTEND=noninteractive
129
+
130
+ RUN <<EOF
131
+ set -eux
132
+ apt-get update
133
+ apt-get install -y \
134
+ build-essential \
135
+ libssl-dev \
136
+ zlib1g-dev \
137
+ libbz2-dev \
138
+ libreadline-dev \
139
+ libsqlite3-dev \
140
+ curl \
141
+ libncursesw5-dev \
142
+ xz-utils \
143
+ tk-dev \
144
+ libxml2-dev \
145
+ libxmlsec1-dev \
146
+ libffi-dev \
147
+ liblzma-dev \
148
+ git
149
+ apt-get clean
150
+ rm -rf /var/lib/apt/lists/*
151
+ EOF
152
+
153
+ ARG PYTHON_VERSION=3.11.3
154
+ ARG PYENV_VERSION=v2.3.17
155
+ ARG PYENV_ROOT=/tmp/.pyenv
156
+ ARG PYBUILD_ROOT=/tmp/python-build
157
+ RUN <<EOF
158
+ set -eux
159
+
160
+ git clone -b "${PYENV_VERSION}" https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
161
+ PREFIX="$PYBUILD_ROOT" "$PYENV_ROOT"/plugins/python-build/install.sh
162
+ "$PYBUILD_ROOT/bin/python-build" -v "$PYTHON_VERSION" /opt/python
163
+
164
+ rm -rf "$PYBUILD_ROOT" "$PYENV_ROOT"
165
+ EOF
166
+
167
+ # FIXME: add /opt/python to PATH
168
+ # not working: /etc/profile read only on login shell
169
+ # not working: /etc/environment is the same
170
+ # not suitable: `ENV` is ignored by docker-compose
171
+ # RUN <<EOF
172
+ # set -eux
173
+ # echo "export PATH=/opt/python/bin:\$PATH" > /etc/profile.d/python-path.sh
174
+ # echo "export LD_LIBRARY_PATH=/opt/python/lib:\$LD_LIBRARY_PATH" >> /etc/profile.d/python-path.sh
175
+ # echo "export C_INCLUDE_PATH=/opt/python/include:\$C_INCLUDE_PATH" >> /etc/profile.d/python-path.sh
176
+ #
177
+ # rm -f /etc/ld.so.cache
178
+ # ldconfig
179
+ # EOF
180
+
181
+
182
+ # Runtime
183
+ FROM ${BASE_RUNTIME_IMAGE} AS runtime-env
184
+ ARG DEBIAN_FRONTEND=noninteractive
185
+
186
+ WORKDIR /opt/voicevox_engine
187
+
188
+ # ca-certificates: pyopenjtalk dictionary download
189
+ # build-essential: pyopenjtalk local build
190
+ # libsndfile1: soundfile shared object for arm64
191
+ # ref: https://github.com/VOICEVOX/voicevox_engine/issues/770
192
+ RUN <<EOF
193
+ set -eux
194
+
195
+ apt-get update
196
+ apt-get install -y \
197
+ git \
198
+ wget \
199
+ cmake \
200
+ ca-certificates \
201
+ build-essential \
202
+ gosu \
203
+ libsndfile1
204
+ apt-get clean
205
+ rm -rf /var/lib/apt/lists/*
206
+
207
+ # Create a general user
208
+ useradd --create-home user
209
+ EOF
210
+
211
+ # Copy python env
212
+ COPY --from=compile-python-env /opt/python /opt/python
213
+
214
+ # Install Python dependencies
215
+ ADD ./requirements.txt /tmp/
216
+ RUN <<EOF
217
+ # Install requirements
218
+ gosu user /opt/python/bin/pip3 install -r /tmp/requirements.txt
219
+ EOF
220
+
221
+ # Copy VOICEVOX Core release
222
+ # COPY --from=download-core-env /etc/ld.so.conf.d/voicevox_core.conf /etc/ld.so.conf.d/voicevox_core.conf
223
+ COPY --from=download-core-env /opt/voicevox_core /opt/voicevox_core
224
+
225
+ # Copy ONNX Runtime
226
+ # COPY --from=download-onnxruntime-env /etc/ld.so.conf.d/onnxruntime.conf /etc/ld.so.conf.d/onnxruntime.conf
227
+ COPY --from=download-onnxruntime-env /opt/onnxruntime /opt/onnxruntime
228
+
229
+ # Add local files
230
+ ADD ./voicevox_engine /opt/voicevox_engine/voicevox_engine
231
+ ADD ./docs /opt/voicevox_engine/docs
232
+ ADD ./run.py ./presets.yaml ./engine_manifest.json /opt/voicevox_engine/
233
+ ADD ./resources /opt/voicevox_engine/resources
234
+ ADD ./tools/generate_licenses.py /opt/voicevox_engine/tools/
235
+ ADD ./tools/licenses /opt/voicevox_engine/tools/licenses
236
+ ADD ./tools/generate_filemap.py /opt/voicevox_engine/tools/
237
+
238
+ # Replace version
239
+ ARG VOICEVOX_ENGINE_VERSION=latest
240
+ RUN sed -i "s/__version__ = \"latest\"/__version__ = \"${VOICEVOX_ENGINE_VERSION}\"/" /opt/voicevox_engine/voicevox_engine/__init__.py
241
+ RUN sed -i "s/\"version\": \"999\\.999\\.999\"/\"version\": \"${VOICEVOX_ENGINE_VERSION}\"/" /opt/voicevox_engine/engine_manifest.json
242
+
243
+ # Generate licenses.json
244
+ ADD ./requirements.txt /tmp/
245
+ ADD ./requirements-dev.txt /tmp/
246
+ RUN <<EOF
247
+ set -eux
248
+
249
+ cd /opt/voicevox_engine
250
+
251
+ # Define temporary env vars
252
+ # /home/user/.local/bin is required to use the commands installed by pip
253
+ export PATH="/home/user/.local/bin:${PATH:-}"
254
+
255
+ gosu user /opt/python/bin/pip3 install -r /tmp/requirements.txt
256
+ # requirements-dev.txt でバージョン指定されている pip-licenses をインストールする
257
+ gosu user /opt/python/bin/pip3 install "$(grep pip-licenses /tmp/requirements-dev.txt | cut -f 1 -d ';')"
258
+ gosu user /opt/python/bin/python3 tools/generate_licenses.py > /opt/voicevox_engine/resources/engine_manifest_assets/dependency_licenses.json
259
+ cp /opt/voicevox_engine/resources/engine_manifest_assets/dependency_licenses.json /opt/voicevox_engine/licenses.json
260
+ EOF
261
+
262
+ # Generate filemap.json
263
+ RUN /opt/python/bin/python3 /opt/voicevox_engine/tools/generate_filemap.py --target_dir /opt/voicevox_engine/resources/character_info
264
+
265
+ # Keep this layer separated to use layer cache on download failed in local build
266
+ RUN <<EOF
267
+ set -eux
268
+
269
+ # Download openjtalk dictionary
270
+ # try 5 times, sleep 5 seconds before retry
271
+ for i in $(seq 5); do
272
+ EXIT_CODE=0
273
+ gosu user /opt/python/bin/python3 -c "import pyopenjtalk; pyopenjtalk._lazy_init()" || EXIT_CODE=$?
274
+ if [ "$EXIT_CODE" = "0" ]; then
275
+ break
276
+ fi
277
+ sleep 5
278
+ done
279
+
280
+ if [ "$EXIT_CODE" != "0" ]; then
281
+ exit "$EXIT_CODE"
282
+ fi
283
+ EOF
284
+
285
+ # Download Resource
286
+ ARG VOICEVOX_RESOURCE_VERSION=0.19.1
287
+ RUN <<EOF
288
+ set -eux
289
+
290
+ # README
291
+ wget -nv --show-progress -c -O "/opt/voicevox_engine/README.md" "https://raw.githubusercontent.com/VOICEVOX/voicevox_resource/${VOICEVOX_RESOURCE_VERSION}/engine/README.md"
292
+ EOF
293
+
294
+ # Create container start shell
295
+ COPY --chmod=775 <<EOF /entrypoint.sh
296
+ #!/bin/bash
297
+ set -eux
298
+
299
+ # Display README for engine
300
+ cat /opt/voicevox_engine/README.md > /dev/stderr
301
+
302
+ exec "\$@"
303
+ EOF
304
+
305
+ ENTRYPOINT [ "/entrypoint.sh" ]
306
+ CMD [ "gosu", "user", "/opt/python/bin/python3", "./run.py", "--voicelib_dir", "/opt/voicevox_core/", "--runtime_dir", "/opt/onnxruntime/lib", "--host", "0.0.0.0" ]
307
+
308
+ # Enable use_gpu
309
+ FROM runtime-env AS runtime-nvidia-env
310
+ CMD [ "gosu", "user", "/opt/python/bin/python3", "./run.py", "--use_gpu", "--voicelib_dir", "/opt/voicevox_core/", "--runtime_dir", "/opt/onnxruntime/lib", "--host", "0.0.0.0" ]
voicevox_engine/LGPL_LICENSE ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
voicevox_engine/LICENSE ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ LGPL v3 と、ソースコードの公開が不要な別ライセンスのデュアルライセンスです。
2
+
3
+ 1. LGPL v3
4
+
5
+ LGPL_LICENSEを参照してください。
6
+
7
+ 2. ソースコードの公開が不要な別ライセンス
8
+
9
+ 別ライセンスを取得したい場合は、ヒホに求めてください。
10
+ X アカウント: @hiho_karuta
voicevox_engine/README.md ADDED
@@ -0,0 +1,652 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VOICEVOX ENGINE
2
+
3
+ [![build](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-package.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-package.yml)
4
+ [![releases](https://img.shields.io/github/v/release/VOICEVOX/voicevox_engine)](https://github.com/VOICEVOX/voicevox_engine/releases)
5
+ [![discord](https://img.shields.io/discord/879570910208733277?color=5865f2&label=&logo=discord&logoColor=ffffff)](https://discord.gg/WMwWetrzuh)
6
+
7
+ [![test](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/test.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/test.yml)
8
+ [![Coverage Status](https://coveralls.io/repos/github/VOICEVOX/voicevox_engine/badge.svg)](https://coveralls.io/github/VOICEVOX/voicevox_engine)
9
+
10
+ [![build-docker](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-container.yml/badge.svg)](https://github.com/VOICEVOX/voicevox_engine/actions/workflows/build-engine-container.yml)
11
+ [![docker](https://img.shields.io/docker/pulls/voicevox/voicevox_engine)](https://hub.docker.com/r/voicevox/voicevox_engine)
12
+
13
+ [VOICEVOX](https://voicevox.hiroshiba.jp/) のエンジンです。
14
+ 実態は HTTP サーバーなので、リクエストを送信すればテキスト音声合成できます。
15
+
16
+ (エディターは [VOICEVOX](https://github.com/VOICEVOX/voicevox/) 、
17
+ コアは [VOICEVOX CORE](https://github.com/VOICEVOX/voicevox_core/) 、
18
+ 全体構成は [こちら](https://github.com/VOICEVOX/voicevox/blob/main/docs/%E5%85%A8%E4%BD%93%E6%A7%8B%E6%88%90.md) に詳細があります。)
19
+
20
+ ## 目次
21
+
22
+ 目的に合わせたガイドはこちらです。
23
+
24
+ - [ユーザーガイド](#ユーザーガイド): 音声合成をしたい方向け
25
+ - [貢献者ガイド](#貢献者ガイド): コントリビュートしたい方向け
26
+ - [開発者ガイド](#開発者ガイド): コードを利用したい方向け
27
+
28
+ ## ユーザーガイド
29
+
30
+ ### ダウンロード
31
+
32
+ [こちら](https://github.com/VOICEVOX/voicevox_engine/releases/latest)から対応するエンジンをダウンロードしてください。
33
+
34
+ ### API ドキュメント
35
+
36
+ [API ドキュメント](https://voicevox.github.io/voicevox_engine/api/)をご参照ください。
37
+
38
+ VOICEVOX エンジンもしくはエディタを起動した状態で http://127.0.0.1:50021/docs にアクセスすると、起動中のエンジンのドキュメントも確認できます。
39
+ 今後の方針などについては [VOICEVOX 音声合成エンジンとの連携](./docs/VOICEVOX音声合成エンジンとの連携.md) も参考になるかもしれません。
40
+
41
+ ### Docker イメージ
42
+
43
+ #### CPU
44
+
45
+ ```bash
46
+ docker pull voicevox/voicevox_engine:cpu-ubuntu20.04-latest
47
+ docker run --rm -p '127.0.0.1:50021:50021' voicevox/voicevox_engine:cpu-ubuntu20.04-latest
48
+ ```
49
+
50
+ #### GPU
51
+
52
+ ```bash
53
+ docker pull voicevox/voicevox_engine:nvidia-ubuntu20.04-latest
54
+ docker run --rm --gpus all -p '127.0.0.1:50021:50021' voicevox/voicevox_engine:nvidia-ubuntu20.04-latest
55
+ ```
56
+
57
+ ##### トラブルシューティング
58
+
59
+ GPU 版を利用する場合、環境によってエラーが発生することがあります。その場合、`--runtime=nvidia`を`docker run`につけて実行すると解決できることがあります。
60
+
61
+ ### HTTP リクエストで音声合成するサンプルコード
62
+
63
+ ```bash
64
+ echo -n "こんにちは、音声合成の世界へようこそ" >text.txt
65
+
66
+ curl -s \
67
+ -X POST \
68
+ "127.0.0.1:50021/audio_query?speaker=1"\
69
+ --get --data-urlencode text@text.txt \
70
+ > query.json
71
+
72
+ curl -s \
73
+ -H "Content-Type: application/json" \
74
+ -X POST \
75
+ -d @query.json \
76
+ "127.0.0.1:50021/synthesis?speaker=1" \
77
+ > audio.wav
78
+ ```
79
+
80
+ 生成される音声はサンプリングレートが 24000Hz と少し特殊なため、音声プレーヤーによっては再生できない場合があります。
81
+
82
+ `speaker` に指定する値は `/speakers` エンドポイントで得られる `style_id` です。互換性のために `speaker` という名前になっています。
83
+
84
+ ### 音声を調整するサンプルコード
85
+
86
+ `/audio_query` で得られる音声合成用のクエリのパラメータを編集することで、音声を調整できます。
87
+
88
+ 例えば、話速を 1.5 倍速にしてみます。
89
+
90
+ ```bash
91
+ echo -n "こんにちは、音声合成の世界へようこそ" >text.txt
92
+
93
+ curl -s \
94
+ -X POST \
95
+ "127.0.0.1:50021/audio_query?speaker=1" \
96
+ --get --data-urlencode text@text.txt \
97
+ > query.json
98
+
99
+ # sed を使用して speedScale の値を 1.5 に変更
100
+ sed -i -r 's/"speedScale":[0-9.]+/"speedScale":1.5/' query.json
101
+
102
+ curl -s \
103
+ -H "Content-Type: application/json" \
104
+ -X POST \
105
+ -d @query.json \
106
+ "127.0.0.1:50021/synthesis?speaker=1" \
107
+ > audio_fast.wav
108
+ ```
109
+
110
+ ### 読み方を AquesTalk 風記法で取得・修正
111
+
112
+ #### AquesTalk 風記法
113
+
114
+ <!-- NOTE: この節は静的リンクとして運用中なので変更しない方が良い(voicevox_engine#816) -->
115
+
116
+ 「**AquesTalk 風記法**」はカタカナと記号だけで読み方を指定する記法です。[AquesTalk 本家の記法](https://www.a-quest.com/archive/manual/siyo_onseikigou.pdf)とは一部が異なります。
117
+ AquesTalk 風記法は次のルールに従います:
118
+
119
+ - 全てのカナはカタカナで記述される
120
+ - アクセント句は `/` または `、` で区切る。 `、` で区切った場合に限り無音区間が挿入される。
121
+ - カナの手前に `_` を入れるとそのカナは無声化される
122
+ - アクセント位置を `'` で指定する。全てのアクセント句にはアクセント位置を 1 つ指定する必要がある。
123
+ - アクセント句末に `?` (全角)を入れることにより疑問文の発音ができる
124
+
125
+ #### AquesTalk 風記法のサンプルコード
126
+
127
+ `/audio_query`のレスポンスにはエンジンが判断した読み方が[AquesTalk 風記法](#aquestalk-風記法)で記述されます。
128
+ これを修正することで音声の読み仮名やアクセントを制御できます。
129
+
130
+ ```bash
131
+ # 読ませたい文章をutf-8でtext.txtに書き出す
132
+ echo -n "ディープラーニングは万能薬ではありません" >text.txt
133
+
134
+ curl -s \
135
+ -X POST \
136
+ "127.0.0.1:50021/audio_query?speaker=1" \
137
+ --get --data-urlencode text@text.txt \
138
+ > query.json
139
+
140
+ cat query.json | grep -o -E "\"kana\":\".*\""
141
+ # 結果... "kana":"ディ'イプ/ラ'アニングワ/バンノオヤクデワアリマセ'ン"
142
+
143
+ # "ディイプラ'アニングワ/バンノ'オヤクデワ/アリマセ'ン"と読ませたいので、
144
+ # is_kana=trueをつけてイントネーションを取得しnewphrases.jsonに保存
145
+ echo -n "ディイプラ'アニングワ/バンノ'オヤクデワ/アリマセ'ン" > kana.txt
146
+ curl -s \
147
+ -X POST \
148
+ "127.0.0.1:50021/accent_phrases?speaker=1&is_kana=true" \
149
+ --get --data-urlencode text@kana.txt \
150
+ > newphrases.json
151
+
152
+ # query.jsonの"accent_phrases"の内容をnewphrases.jsonの内容に置き換える
153
+ cat query.json | sed -e "s/\[{.*}\]/$(cat newphrases.json)/g" > newquery.json
154
+
155
+ curl -s \
156
+ -H "Content-Type: application/json" \
157
+ -X POST \
158
+ -d @newquery.json \
159
+ "127.0.0.1:50021/synthesis?speaker=1" \
160
+ > audio.wav
161
+ ```
162
+
163
+ ### ユーザー辞書機能について
164
+
165
+ API からユーザー辞書の参照、単語の追加、編集、削除を行うことができます。
166
+
167
+ #### 参照
168
+
169
+ `/user_dict`に GET リクエストを投げることでユーザー辞書の一覧を取得することができます。
170
+
171
+ ```bash
172
+ curl -s -X GET "127.0.0.1:50021/user_dict"
173
+ ```
174
+
175
+ #### 単語追加
176
+
177
+ `/user_dict_word`に POST リクエストを投げる事でユーザー辞書に単語を追加することができます。
178
+ URL パラメータとして、以下が必要です。
179
+
180
+ - surface (辞書に登録する単語)
181
+ - pronunciation (カタカナでの読み方)
182
+ - accent_type (アクセント核位置、整数)
183
+
184
+ アクセント核位置については、こちらの文章が参考になるかと思います。
185
+ 〇型となっている数字の部分がアクセント核位置になります。
186
+ https://tdmelodic.readthedocs.io/ja/latest/pages/introduction.html
187
+
188
+ 成功した場合の返り値は単語に割り当てられる UUID の文字列になります。
189
+
190
+ ```bash
191
+ surface="test"
192
+ pronunciation="テスト"
193
+ accent_type="1"
194
+
195
+ curl -s -X POST "127.0.0.1:50021/user_dict_word" \
196
+ --get \
197
+ --data-urlencode "surface=$surface" \
198
+ --data-urlencode "pronunciation=$pronunciation" \
199
+ --data-urlencode "accent_type=$accent_type"
200
+ ```
201
+
202
+ #### 単語修正
203
+
204
+ `/user_dict_word/{word_uuid}`に PUT リクエストを投げる事でユーザー辞書の単語を修正することができます。
205
+ URL パラメータとして、以下が必要です。
206
+
207
+ - surface (辞書に登録するワード)
208
+ - pronunciation (カタカナでの読み方)
209
+ - accent_type (アクセント核位置、整数)
210
+
211
+ word_uuid は単語追加時に確認できるほか、ユーザー辞書を参照することでも確認できます。
212
+ 成功した場合の返り値は`204 No Content`になります。
213
+
214
+ ```bash
215
+ surface="test2"
216
+ pronunciation="テストツー"
217
+ accent_type="2"
218
+ # 環境によってword_uuidは適宜書き換えてください
219
+ word_uuid="cce59b5f-86ab-42b9-bb75-9fd3407f1e2d"
220
+
221
+ curl -s -X PUT "127.0.0.1:50021/user_dict_word/$word_uuid" \
222
+ --get \
223
+ --data-urlencode "surface=$surface" \
224
+ --data-urlencode "pronunciation=$pronunciation" \
225
+ --data-urlencode "accent_type=$accent_type"
226
+ ```
227
+
228
+ #### 単語削除
229
+
230
+ `/user_dict_word/{word_uuid}`に DELETE リクエストを投げる事でユーザー辞書の単語を削除することができます。
231
+
232
+ word_uuid は単語追加時に確認できるほか、ユーザー辞書を参照することでも確認できます。
233
+ 成功した場合の返り値は`204 No Content`になります。
234
+
235
+ ```bash
236
+ # 環境によってword_uuidは適宜書き換えてくだ��い
237
+ word_uuid="cce59b5f-86ab-42b9-bb75-9fd3407f1e2d"
238
+
239
+ curl -s -X DELETE "127.0.0.1:50021/user_dict_word/$word_uuid"
240
+ ```
241
+
242
+ #### 辞書のインポート&エクスポート
243
+
244
+ エンジンの[設定ページ](http://127.0.0.1:50021/setting)内の「ユーザー辞書のエクスポート&インポート」節で、ユーザー辞書のインポート&エクスポートが可能です。
245
+
246
+ 他にも API でユーザー辞書のインポート&エクスポートが可能です。
247
+ インポートには `POST /import_user_dict`、エクスポートには `GET /user_dict` を利用します。
248
+ 引数等の詳細は API ドキュメントをご覧ください。
249
+
250
+ ### プリセット機能について
251
+
252
+ `presets.yaml`を編集することでキャラクターや話速などのプリセットを使うことができます。
253
+
254
+ ```bash
255
+ echo -n "プリセットをうまく活用すれば、サードパーティ間で同じ設定を使うことができます" >text.txt
256
+
257
+ # プリセット情報を取得
258
+ curl -s -X GET "127.0.0.1:50021/presets" > presets.json
259
+
260
+ preset_id=$(cat presets.json | sed -r 's/^.+"id"\:\s?([0-9]+?).+$/\1/g')
261
+ style_id=$(cat presets.json | sed -r 's/^.+"style_id"\:\s?([0-9]+?).+$/\1/g')
262
+
263
+ # 音声合成用のクエリを取得
264
+ curl -s \
265
+ -X POST \
266
+ "127.0.0.1:50021/audio_query_from_preset?preset_id=$preset_id"\
267
+ --get --data-urlencode text@text.txt \
268
+ > query.json
269
+
270
+ # 音声合成
271
+ curl -s \
272
+ -H "Content-Type: application/json" \
273
+ -X POST \
274
+ -d @query.json \
275
+ "127.0.0.1:50021/synthesis?speaker=$style_id" \
276
+ > audio.wav
277
+ ```
278
+
279
+ - `speaker_uuid`は、`/speakers`で確認できます
280
+ - `id`は重複してはいけません
281
+ - エンジン起動後にファイルを書き換えるとエンジンに反映されます
282
+
283
+ ### 2 種類のスタイルでモーフィングするサンプルコード
284
+
285
+ `/synthesis_morphing`では、2 種類のスタイルでそれぞれ合成された音声を元に、モーフィングした音声を生成します。
286
+
287
+ ```bash
288
+ echo -n "モーフィングを利用することで、2種類の声を混ぜることができます。" > text.txt
289
+
290
+ curl -s \
291
+ -X POST \
292
+ "127.0.0.1:50021/audio_query?speaker=8"\
293
+ --get --data-urlencode text@text.txt \
294
+ > query.json
295
+
296
+ # 元のスタイルでの合成結果
297
+ curl -s \
298
+ -H "Content-Type: application/json" \
299
+ -X POST \
300
+ -d @query.json \
301
+ "127.0.0.1:50021/synthesis?speaker=8" \
302
+ > audio.wav
303
+
304
+ export MORPH_RATE=0.5
305
+
306
+ # スタイル2種類分の音声合成+WORLDによる音声分析が入るため時間が掛かるので注意
307
+ curl -s \
308
+ -H "Content-Type: application/json" \
309
+ -X POST \
310
+ -d @query.json \
311
+ "127.0.0.1:50021/synthesis_morphing?base_speaker=8&target_speaker=10&morph_rate=$MORPH_RATE" \
312
+ > audio.wav
313
+
314
+ export MORPH_RATE=0.9
315
+
316
+ # query、base_speaker、target_speakerが同じ場合はキャッシュが使用されるため比較的高速に生成される
317
+ curl -s \
318
+ -H "Content-Type: application/json" \
319
+ -X POST \
320
+ -d @query.json \
321
+ "127.0.0.1:50021/synthesis_morphing?base_speaker=8&target_speaker=10&morph_rate=$MORPH_RATE" \
322
+ > audio.wav
323
+ ```
324
+
325
+ ### キャラクターの追加情報を取得するサンプルコード
326
+
327
+ 追加情報の中の portrait.png を取得するコードです。
328
+ ([jq](https://stedolan.github.io/jq/)を使用して json をパースしています。)
329
+
330
+ ```bash
331
+ curl -s -X GET "127.0.0.1:50021/speaker_info?speaker_uuid=7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff" \
332
+ | jq -r ".portrait" \
333
+ | base64 -d \
334
+ > portrait.png
335
+ ```
336
+
337
+ ### キャンセル可能な音声合成
338
+
339
+ `/cancellable_synthesis`では通信を切断した場合に即座に計算リソースが開放されます。
340
+ (`/synthesis`では通信を切断しても最後まで音声合成の計算が行われます)
341
+ この API は実験的機能であり、エンジン起動時に引数で`--enable_cancellable_synthesis`を指定しないと有効化されません。
342
+ 音声合成に必要なパラメータは`/synthesis`と同様です。
343
+
344
+ ### HTTP リクエストで歌声合成するサンプルコード
345
+
346
+ ```bash
347
+ echo -n '{
348
+ "notes": [
349
+ { "key": null, "frame_length": 15, "lyric": "" },
350
+ { "key": 60, "frame_length": 45, "lyric": "ド" },
351
+ { "key": 62, "frame_length": 45, "lyric": "レ" },
352
+ { "key": 64, "frame_length": 45, "lyric": "ミ" },
353
+ { "key": null, "frame_length": 15, "lyric": "" }
354
+ ]
355
+ }' > score.json
356
+
357
+ curl -s \
358
+ -H "Content-Type: application/json" \
359
+ -X POST \
360
+ -d @score.json \
361
+ "127.0.0.1:50021/sing_frame_audio_query?speaker=6000" \
362
+ > query.json
363
+
364
+ curl -s \
365
+ -H "Content-Type: application/json" \
366
+ -X POST \
367
+ -d @query.json \
368
+ "127.0.0.1:50021/frame_synthesis?speaker=3001" \
369
+ > audio.wav
370
+ ```
371
+
372
+ スコアの`key`は MIDI 番号です。
373
+ `lyric`は歌詞で、任意の文字列を指定できますが、エンジンによってはひらがな・カタカナ1モーラ以外の文字列はエラーになるこ���があります。
374
+ フレームレートはデフォルトが 93.75Hz で、エンジンマニフェストの`frame_rate`で取得できます。
375
+ 1つ目のノートは無音である必要があります。
376
+
377
+ `/sing_frame_audio_query`で指定できる`speaker`は、`/singers`で取得できるスタイルの内、種類が`sing`か`singing_teacher`なスタイルの`style_id`です。
378
+ `/frame_synthesis`で指定できる`speaker`は、`/singers`で取得できるスタイルの内、種類が`frame_decode`の`style_id`です。
379
+ 引数が `speaker` という名前になっているのは、他の API と一貫性をもたせるためです。
380
+
381
+ `/sing_frame_audio_query`と`/frame_synthesis`に異なるスタイルを指定することも可能です。
382
+
383
+ ### CORS 設定
384
+
385
+ VOICEVOX ではセキュリティ保護のため`localhost`・`127.0.0.1`・`app://`・Origin なし以外の Origin からリクエストを受け入れないようになっています。
386
+ そのため、一部のサードパーティアプリからのレスポンスを受け取れない可能性があります。
387
+ これを回避する方法として、エンジンから設定できる UI を用意しています。
388
+
389
+ #### 設定方法
390
+
391
+ 1. <http://127.0.0.1:50021/setting> にアクセスします。
392
+ 2. 利用するアプリに合わせて設定を変更、追加してください。
393
+ 3. 保存ボタンを押して、変更を確定してください。
394
+ 4. 設定の適用にはエンジンの再起動が必要です。必要に応じて再起動をしてください。
395
+
396
+ ### データを変更する API を無効化する
397
+
398
+ 実行時引数`--disable_mutable_api`か環境変数`VV_DISABLE_MUTABLE_API=1`を指定することで、エンジンの設定や辞書などを変更する API を無効にできます。
399
+
400
+ ### 文字コード
401
+
402
+ リクエスト・レスポンスの文字コードはすべて UTF-8 です。
403
+
404
+ ### その他の引数
405
+
406
+ エンジン起動時に引数を指定できます。詳しいことは`-h`引数でヘルプを確認してください。
407
+
408
+ ```bash
409
+ $ python run.py -h
410
+
411
+ usage: run.py [-h] [--host HOST] [--port PORT] [--use_gpu] [--voicevox_dir VOICEVOX_DIR] [--voicelib_dir VOICELIB_DIR] [--runtime_dir RUNTIME_DIR] [--enable_mock] [--enable_cancellable_synthesis]
412
+ [--init_processes INIT_PROCESSES] [--load_all_models] [--cpu_num_threads CPU_NUM_THREADS] [--output_log_utf8] [--cors_policy_mode {CorsPolicyMode.all,CorsPolicyMode.localapps}]
413
+ [--allow_origin [ALLOW_ORIGIN ...]] [--setting_file SETTING_FILE] [--preset_file PRESET_FILE] [--disable_mutable_api]
414
+
415
+ VOICEVOX のエンジンです。
416
+
417
+ options:
418
+ -h, --help show this help message and exit
419
+ --host HOST 接続を受け付けるホストアドレスです。
420
+ --port PORT 接続を受け付けるポート番号です。
421
+ --use_gpu GPUを使って音声合成するようになります。
422
+ --voicevox_dir VOICEVOX_DIR
423
+ VOICEVOXのディレクトリパスです。
424
+ --voicelib_dir VOICELIB_DIR
425
+ VOICEVOX COREのディレクトリパスです。
426
+ --runtime_dir RUNTIME_DIR
427
+ VOICEVOX COREで使用するライブラリのディレクトリパスです。
428
+ --enable_mock VOICEVOX COREを使わずモックで音声合成を行います。
429
+ --enable_cancellable_synthesis
430
+ 音声合成を途中でキャンセルできるようになります。
431
+ --init_processes INIT_PROCESSES
432
+ cancellable_synthesis機能の初期化時に生成するプロセス数です。
433
+ --load_all_models 起動時に全ての音声合成モデルを読み込みます。
434
+ --cpu_num_threads CPU_NUM_THREADS
435
+ 音声合成を行うスレッド数です。指定しない場合、代わりに環境変数 VV_CPU_NUM_THREADS の値が使われます。VV_CPU_NUM_THREADS が空文字列でなく数値でもない場合はエラー終了します。
436
+ --output_log_utf8 ログ出力をUTF-8でおこないます。指定しない場合、代わりに環境変数 VV_OUTPUT_LOG_UTF8 の値が使われます。VV_OUTPUT_LOG_UTF8 の値が1の場合はUTF-8で、0または空文字、値がない場合は環境によって自動的に決定されます。
437
+ --cors_policy_mode {CorsPolicyMode.all,CorsPolicyMode.localapps}
438
+ CORSの許可モード。allまたはlocalappsが指定できます。allはすべてを許可します。localappsはオリジン間リソース共有ポリシーを、app://.とlocalhost関連に限定します。その他のオリジンはallow_originオプションで追加できます。デフォルトはlocalapps。このオプションは--
439
+ setting_fileで指定される設定ファイルよりも優先されます。
440
+ --allow_origin [ALLOW_ORIGIN ...]
441
+ 許可するオリジンを指定します。スペースで区切ることで複数指定できま��。このオプションは--setting_fileで指定される設定ファイルよりも優先されます。
442
+ --setting_file SETTING_FILE
443
+ 設定ファイルを指定できます。
444
+ --preset_file PRESET_FILE
445
+ プリセットファイルを指定できます。指定がない場合、環境変数 VV_PRESET_FILE、実行ファイルのディレクトリのpresets.yamlを順に探します。
446
+ --disable_mutable_api
447
+ 辞書登録や設定変更など、エンジンの静的なデータを変更するAPIを無効化します。指定しない場合、代わりに環境変数 VV_DISABLE_MUTABLE_API の値が使われます。VV_DISABLE_MUTABLE_API の値が1の場合は無効化で、0または空文字、値がない場合は無視されます。
448
+ ```
449
+
450
+ ### アップデート
451
+
452
+ エンジンディレクトリ内にあるファイルを全て消去し、新しいものに置き換えてください。
453
+
454
+ ## 貢献者ガイド
455
+
456
+ VOICEVOX ENGINE は皆さんのコントリビューションをお待ちしています!
457
+ 詳細は [CONTRIBUTING.md](./CONTRIBUTING.md) をご覧ください。
458
+ また [VOICEVOX 非公式 Discord サーバー](https://discord.gg/WMwWetrzuh)にて、開発の議論や雑談を行っています。気軽にご参加ください。
459
+
460
+ なお、Issue を解決するプルリクエストを作成される際は、別の方と同じ Issue に取り組むことを避けるため、Issue 側で取り組み始めたことを伝えるか、最初に Draft プルリクエストを作成することを推奨しています。
461
+
462
+ ## 開発者ガイド
463
+
464
+ ### 環境構築
465
+
466
+ `Python 3.11.3` を用いて開発されています。
467
+ インストールするには、各 OS ごとの C/C++ コンパイラ、CMake が必要になります。
468
+
469
+ ```bash
470
+ # 実行環境のインストール
471
+ python -m pip install -r requirements.txt
472
+
473
+ # 開発環境・テスト環境・ビルド環境のインストール
474
+ python -m pip install -r requirements-dev.txt -r requirements-build.txt
475
+ ```
476
+
477
+ ### 実行
478
+
479
+ コマンドライン引数の詳細は以下のコマンドで確認してください。
480
+
481
+ ```bash
482
+ python run.py --help
483
+ ```
484
+
485
+ ```bash
486
+ # 製品版 VOICEVOX でサーバーを起動
487
+ VOICEVOX_DIR="C:/path/to/voicevox" # 製品版 VOICEVOX ディレクトリのパス
488
+ python run.py --voicevox_dir=$VOICEVOX_DIR
489
+ ```
490
+
491
+ <!-- 差し替え可能な音声ライブラリまたはその仕様が公開されたらコメントを外す
492
+ ```bash
493
+ # 音声ライブラリを差し替える
494
+ VOICELIB_DIR="C:/path/to/your/tts-model"
495
+ python run.py --voicevox_dir=$VOICEVOX_DIR --voicelib_dir=$VOICELIB_DIR
496
+ ```
497
+ -->
498
+
499
+ ```bash
500
+ # モックでサーバー起動
501
+ python run.py --enable_mock
502
+ ```
503
+
504
+ ```bash
505
+ # ログをUTF8に変更
506
+ python run.py --output_log_utf8
507
+ # もしくは VV_OUTPUT_LOG_UTF8=1 python run.py
508
+ ```
509
+
510
+ #### CPU スレッド数を指定する
511
+
512
+ CPU スレッド数が未指定の場合は、論理コア数の半分が使われます。(殆どの CPU で、これは全体の処理能力の半分です)
513
+ もし IaaS 上で実行していたり、専用サーバーで実行している場合など、
514
+ エンジンが使う処理能力を調節したい場合は、CPU スレッド数を指定することで実現できます。
515
+
516
+ - 実行時引数で指定する
517
+ ```bash
518
+ python run.py --voicevox_dir=$VOICEVOX_DIR --cpu_num_threads=4
519
+ ```
520
+ - 環境変数で指定する
521
+ ```bash
522
+ export VV_CPU_NUM_THREADS=4
523
+ python run.py --voicevox_dir=$VOICEVOX_DIR
524
+ ```
525
+
526
+ #### 過去のバージョンのコアを使う
527
+
528
+ VOICEVOX Core 0.5.4 以降のコアを使用する事が可能です。
529
+ Mac での libtorch 版コアのサポートはしていません。
530
+
531
+ ##### 過去のバイナリを指定する
532
+
533
+ 製品版 VOICEVOX もしくはコンパイル済みエンジンのディレクトリを`--voicevox_dir`引数で指定すると、そのバージョンのコアが使用されます。
534
+
535
+ ```bash
536
+ python run.py --voicevox_dir="/path/to/voicevox"
537
+ ```
538
+
539
+ Mac では、`DYLD_LIBRARY_PATH`の指定が必要です。
540
+
541
+ ```bash
542
+ DYLD_LIBRARY_PATH="/path/to/voicevox" python run.py --voicevox_dir="/path/to/voicevox"
543
+ ```
544
+
545
+ ##### 音声ライブラリを直接指定する
546
+
547
+ [VOICEVOX Core の zip ファイル](https://github.com/VOICEVOX/voicevox_core/releases)を解凍したディレクトリを`--voicelib_dir`引数で指定します。
548
+ また、コアのバージョンに合わせて、[libtorch](https://pytorch.org/)や[onnxruntime](https://github.com/microsoft/onnxruntime) (共有ライブラリ) のディレクトリを`--runtime_dir`引数で指定します。
549
+ ただし、システムの探索パス上に libtorch、onnxruntime がある場合、`--runtime_dir`引数の指定は不要です。
550
+ `--voicelib_dir`引数、`--runtime_dir`引数は複数回使用可能です。
551
+ API エンドポイントでコアのバージョンを指定する場合は`core_version`引数を指定してください。(未指定の場���は最新のコアが使用されます)
552
+
553
+ ```bash
554
+ python run.py --voicelib_dir="/path/to/voicevox_core" --runtime_dir="/path/to/libtorch_or_onnx"
555
+ ```
556
+
557
+ Mac では、`--runtime_dir`引数の代わりに`DYLD_LIBRARY_PATH`の指定が必要です。
558
+
559
+ ```bash
560
+ DYLD_LIBRARY_PATH="/path/to/onnx" python run.py --voicelib_dir="/path/to/voicevox_core"
561
+ ```
562
+
563
+ ##### ユーザーディレクトリに配置する
564
+
565
+ 以下のディレクトリにある音声ライブラリは自動で読み込まれます。
566
+
567
+ - ビルド版: `<user_data_dir>/voicevox-engine/core_libraries/`
568
+ - Python 版: `<user_data_dir>/voicevox-engine-dev/core_libraries/`
569
+
570
+ `<user_data_dir>`は OS によって異なります。
571
+
572
+ - Windows: `C:\Users\<username>\AppData\Local\`
573
+ - macOS: `/Users/<username>/Library/Application\ Support/`
574
+ - Linux: `/home/<username>/.local/share/`
575
+
576
+ ### ビルド
577
+
578
+ `pyinstaller` を用いたパッケージ化と Dockerfile を用いたコンテナ化によりローカルでビルドが可能です。
579
+ 手順の詳細は [貢献者ガイド#ビルド](./CONTRIBUTING.md#ビルド) を御覧ください。
580
+
581
+ GitHub を用いる場合、fork したリポジトリで GitHub Actions によるビルドが可能です。
582
+ Actions を ON にし、workflow_dispatch で`build-engine-package.yml`を起動すればビルドできます。
583
+ 成果物は Release にアップロードされます。
584
+ ビルドに必要な GitHub Actions の設定は [貢献者ガイド#GitHub Actions](./CONTRIBUTING.md#github-actions) を御覧ください。
585
+
586
+ ### テスト・静的解析
587
+
588
+ `pytest` を用いたテストと各種リンターを用いた静的解析が可能です。
589
+ 手順の詳細は [貢献者ガイド#テスト](./CONTRIBUTING.md#テスト), [貢献者ガイド#静的解析](./CONTRIBUTING.md#静的解析) を御覧ください。
590
+
591
+ ### 依存関係
592
+
593
+ 依存関係は `poetry` で管理されています。また、導入可能な依存ライブラリにはライセンス上の制約があります。
594
+ 詳細は [貢献者ガイド#パッケージ](./CONTRIBUTING.md#パッケージ) を御覧ください。
595
+
596
+ ### マルチエンジン機能に関して
597
+
598
+ VOICEVOX エディターでは、複数のエンジンを同時に起動することができます。
599
+ この機能を利用することで、自作の音声合成エンジンや既存の音声合成エンジンを VOICEVOX エディター上で動かすことが可能です。
600
+
601
+ <img src="./docs/res/マルチエンジン概念図.svg" width="320">
602
+
603
+ <details>
604
+
605
+ #### マルチエンジン機能の仕組み
606
+
607
+ VOICEVOX API に準拠した複数のエンジンの Web API をポートを分けて起動し、統一的に扱うことでマルチエンジン機能を実現しています。
608
+ エディターがそれぞれのエンジンを実行バイナリ経由で起動し、EngineID と結びつけて設定や状態を個別管理します。
609
+
610
+ #### マルチエンジン機能への対応方法
611
+
612
+ VOICEVOX API 準拠エンジンを起動する実行バイナリを作ることで対応が可能です。
613
+ VOICEVOX ENGINE リポジトリを fork し、一部の機能を改造するのが簡単です。
614
+
615
+ 改造すべき点はエンジン情報・キャラクター情報・音声合成の3点です。
616
+
617
+ エンジンの情報はルート直下のマニフェストファイル(`engine_manifest.json`)で管理されています。
618
+ この形式のマニフェストファイルは VOICEVOX API 準拠エンジンに必須です。
619
+ マニフェストファイル内の情報を見て適宜変更してください。
620
+ 音声合成手法によっては、例えばモーフィング機能など、VOICEVOX と同じ機能を持つことができない場合があります。
621
+ その場合はマニフェストファイル内の`supported_features`内の情報を適宜変更してください。
622
+
623
+ キャラクター情報は`resources/character_info`ディレクトリ内のファイルで管理されています。
624
+ ダミーのアイコンなどが用意されているので適宜変更してください。
625
+
626
+ 音声合成は`voicevox_engine/tts_pipeline/tts_engine.py`で行われています。
627
+ VOICEVOX API での音声合成は、エンジン側で音声合成用のクエリ `AudioQuery` の初期値を作成してユーザーに返し、ユーザーが必要に応じてクエリを編集したあと、エンジンがクエリに従って音声合成することで実現しています。
628
+ クエリ作成は`/audio_query`エンドポイントで、音声合成は`/synthesis`エンドポイントで行っており、最低この2つに対応すれば VOICEVOX API に準拠したことになります。
629
+
630
+ #### マルチエンジン機能対応エンジンの配布方法
631
+
632
+ VVPP ファイルとして配布するのがおすすめです。
633
+ VVPP は「VOICEVOX プラグインパッケージ」の略で、中身はビルドしたエンジンなどを含んだディレクトリの Zip ファイルです。
634
+ 拡張子を`.vvpp`にすると、ダブルクリックで VOICEVOX エディターにインストールできます。
635
+
636
+ エディター側は受け取った VVPP ファイルをローカルディスク上に Zip 展開したあと、ルートの直下にある`engine_manifest.json`に従ってファイルを探査します。
637
+ VOICEVOX エディターにうまく読み込ませられないときは、エディターのエラーログを参照してください。
638
+
639
+ また、`xxx.vvpp`は分割して連番を付けた`xxx.0.vvppp`ファイルとして配布することも可能です。
640
+ これはファイル容量が大きくて配布が困難な場合に有用です。
641
+
642
+ </details>
643
+
644
+ ## 事例紹介
645
+
646
+ **[voicevox-client](https://github.com/voicevox-client) [@voicevox-client](https://github.com/voicevox-client)** ・・・ VOICEVOX ENGINE の各言語向け API ラッパー
647
+
648
+ ## ライセンス
649
+
650
+ LGPL v3 と、ソースコードの公開が不要な別ライセンスのデュアルライセンスです。
651
+ 別ライセンスを取得したい場合は、ヒホに求めてください。
652
+ X アカウント: [@hiho_karuta](https://x.com/hiho_karuta)
voicevox_engine/docs/VOICEVOX音声合成エンジンとの連携.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ メモ書き程度ですが、どういう方針で開発を進めているかを紹介します。
2
+
3
+ - バージョンが上がっても、`/audio_query`で返ってくる値をそのまま`/synthesis`に POST すれば音声合成できるようにする予定です
4
+ - `AudioQuery`のパラメータは増えますが、なるべくデフォルト値で以前と変わらない音声が生成されるようにします
5
+ - 以前のバージョンの`AudioQuery`を新しいバージョンの`/synthesis`にそのまま POST できるようにします(後方互換)
6
+ - バージョン 0.7 から音声スタイルが実装されました。スタイルの情報は`/speakers`及び`/singers`から取得できます
7
+ - スタイルの情報にある`style_id`を`speaker`に指定することで、今まで通り音声合成ができます
8
+ - `style_id`の指定先が`speaker`なのは互換性のためです
voicevox_engine/docs/api/.gitkeep ADDED
File without changes
voicevox_engine/docs/res/マルチエンジン概念図.svg ADDED
voicevox_engine/docs/リソースファイルのURLとfilemap.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # リソースファイルの URL の仕様について
2
+
3
+ VOICEVOX ENGINE では一部のリソースファイルを URL として返します。
4
+ リソースファイルを更新しても URL が同じ場合、キャッシュが働いて新しいリソースを取得できないことがあります。
5
+ これを防ぐためにリソースファイルのハッシュ値を URL に含め、リソースの変更の度に URL が変わるようにしています。
6
+
7
+ ResourceManager はファイルとハッシュの対応を管理します。
8
+ filemap.json はファイルとハッシュを予め対応付けたファイルです。
9
+ generate_filemap.py は filemap.json の作成を行います。
10
+
11
+ ## ResourceManager
12
+
13
+ `filemap.json`にあるリソースファイルを登録できます。
14
+ 初期化時に`create_filemap_if_not_exist`を`True`にすると`filemap.json`がないディレクトリの登録ができます。
15
+
16
+ 細かい仕様は ResourceManager のドキュメントと実装を確認してください。
17
+
18
+ ## filemap.json
19
+
20
+ `filemap.json`のキーは、登録するディレクトリからリソースファイルへの相対パスです。
21
+ パス区切り文字は互換性のため`/`である必要があります。
22
+
23
+ 値は登録するファイルを一意に識別できるハッシュ等の文字列です。
24
+ `generate_filemap.py`は sha256 ハッシュを生成します。
25
+
26
+ ### 例
27
+
28
+ #### デイレクトリ構造
29
+
30
+ ```
31
+ 登録ディレクトリ/
32
+ ├── filemap.json
33
+ ├── dir_1/
34
+ │ ├── 登録ファイル.png
35
+ │ ├── samples/
36
+ │ │ └── 登録ファイル.wav
37
+ │ └── 非登録ファイル1.txt
38
+ └── dir_2/
39
+ ├── 登録ファイル.png
40
+ ├── samples/
41
+ │ └── 登録ファイル.wav
42
+ └── 非登録ファイル1.txt
43
+ ```
44
+
45
+ #### filemap.json
46
+
47
+ ```json
48
+ {
49
+ "dir_1/登録ファイル.png": "HASH-1",
50
+ "dir_1/samples/登録ファイル.wav": "HASH-2",
51
+ "dir_2/登録ファイル.png": "HASH-3",
52
+ "dir_2/samples/登録ファイル.wav": "HASH-4"
53
+ }
54
+ ```
55
+
56
+ ## generate_filemap.py
57
+
58
+ `filemap.json`を生成するためのスクリプトです。
59
+ デフォルトでは png ファイルと wav ファイルのみを登録します。
60
+
61
+ ### 例
62
+
63
+ ```bash
64
+ python tools/generate_filemap.py --target_dir resources/character_info
65
+ ```
66
+
67
+ png と wav に加えて jpg ファイルを登録する例
68
+
69
+ ```bash
70
+ python tools/generate_filemap.py --target_dir resources/character_info \
71
+ --target_suffix png --target_suffix wav --target_suffix jpg
72
+ ```
voicevox_engine/docs/用語集.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 用語集
2
+
3
+ エンジン内で用いられている用語をまとめています。
4
+ 随時追加予定です。お気軽に追加プルリクエストを送ってください!
5
+
6
+ <!--
7
+ * 見出しは「### 日本語の名前: コード内での名前(小文字)」
8
+ * コード内にしか出てこない用語はコード内での名前のみでもOK
9
+ * 説明は1~3行くらいで
10
+ * 基本的に改行を入れない(末尾にスペース2つを入れない)
11
+ -->
12
+
13
+ ## ドメイン用語
14
+
15
+ TODO: ユーザー向けに案内されている用語をまとめる
16
+
17
+ ## エンジン周り
18
+
19
+ TODO
20
+
21
+ ## OpenJTalk 周り
22
+
23
+ ### フルコンテキストラベル: full-context label
24
+
25
+ 文章構造を解析して得たデータを音素ごとにまとめたもの。あるいはその集合。
26
+ 何の音素か、何番目のモーラか、何番目のアクセント句なのかといった情報が含まれる。
27
+ HTS の概念。
28
+
29
+ ### ラベル: label
30
+
31
+ 1つの音素のフルコンテキストラベルのこと。
32
+ VOICEVOX 独自の定義(OpenJTalk 内ではフルコンテキストラベルを指してラベルと呼んでいる)。
33
+
34
+ ### コンテキスト: context
35
+
36
+ フルコンテキスト内の1つの要素のこと。
37
+ VOICEVOX 独自の定義。
38
+
39
+ ### feature
40
+
41
+ ラベルを1行の文字列にしたもの。
42
+ OpenJTalk の概念。
voicevox_engine/engine_manifest.json ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "manifest_version": "0.13.1",
3
+ "name": "DUMMY Engine",
4
+ "brand_name": "DUMMY",
5
+ "uuid": "c7b58856-bd56-4aa1-afb7-b8415f824b06",
6
+ "version": "999.999.999",
7
+ "url": "https://github.com/VOICEVOX/voicevox_engine",
8
+ "command": "run",
9
+ "port": 50021,
10
+ "icon": "resources/engine_manifest_assets/icon.png",
11
+ "default_sampling_rate": 24000,
12
+ "frame_rate": 93.75,
13
+ "terms_of_service": "resources/engine_manifest_assets/terms_of_service.md",
14
+ "update_infos": "resources/engine_manifest_assets/update_infos.json",
15
+ "dependency_licenses": "resources/engine_manifest_assets/dependency_licenses.json",
16
+ "supported_features": {
17
+ "adjust_mora_pitch": {
18
+ "type": "bool",
19
+ "value": true,
20
+ "name": "モーラごとの音高の調整"
21
+ },
22
+ "adjust_phoneme_length": {
23
+ "type": "bool",
24
+ "value": true,
25
+ "name": "音素ごとの長さの調整"
26
+ },
27
+ "adjust_speed_scale": {
28
+ "type": "bool",
29
+ "value": true,
30
+ "name": "全体の話速の調整"
31
+ },
32
+ "adjust_pitch_scale": {
33
+ "type": "bool",
34
+ "value": true,
35
+ "name": "全体の音高の調整"
36
+ },
37
+ "adjust_intonation_scale": {
38
+ "type": "bool",
39
+ "value": true,
40
+ "name": "全体の抑揚の調整"
41
+ },
42
+ "adjust_volume_scale": {
43
+ "type": "bool",
44
+ "value": true,
45
+ "name": "全体の音量の調整"
46
+ },
47
+ "adjust_pause_length": {
48
+ "type": "bool",
49
+ "value": true,
50
+ "name": "句読点などの無音時間の調整"
51
+ },
52
+ "interrogative_upspeak": {
53
+ "type": "bool",
54
+ "value": true,
55
+ "name": "疑問文の自動調整"
56
+ },
57
+ "synthesis_morphing" : {
58
+ "type": "bool",
59
+ "value": true,
60
+ "name": "2種類のスタイルでモーフィングした音声を合成"
61
+ },
62
+ "sing" : {
63
+ "type": "bool",
64
+ "value": true,
65
+ "name": "歌唱音声合成"
66
+ },
67
+ "manage_library": {
68
+ "type": "bool",
69
+ "value": true,
70
+ "name": "音声ライブラリのインストール・アンインストール"
71
+ },
72
+ "return_resource_url":{
73
+ "type":"bool",
74
+ "value":true,
75
+ "name": "speaker_info・singer_infoのリソースをURLで返送"
76
+ }
77
+ }
78
+ }
voicevox_engine/poetry.lock ADDED
The diff for this file is too large to render. See raw diff
 
voicevox_engine/presets.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ - id: 1
2
+ name: サンプルプリセット
3
+ speaker_uuid: 7ffcb7ce-00ec-4bdc-82cd-45a8889e43ff
4
+ style_id: 0
5
+ speedScale: 1
6
+ pitchScale: 0
7
+ intonationScale: 1
8
+ volumeScale: 1
9
+ prePhonemeLength: 0.1
10
+ postPhonemeLength: 0.1
11
+ pauseLength: null
12
+ pauseLengthScale: 1
voicevox_engine/pyproject.toml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.pysen]
2
+ version = "0.11.0"
3
+
4
+ [tool.pysen.lint]
5
+ enable_black = true
6
+ enable_flake8 = true
7
+ enable_isort = true
8
+ enable_mypy = true
9
+ mypy_preset = "strict"
10
+ mypy_plugins = [
11
+ { function = "numpy.typing.mypy_plugin" },
12
+ { function = "pydantic.mypy" },
13
+ ]
14
+ line_length = 88
15
+ py_version = "py311"
16
+ isort_known_first_party = ["voicevox_engine"]
17
+ isort_known_third_party = ["numpy"]
18
+ [[tool.pysen.lint.mypy_targets]]
19
+ paths = ["."]
20
+
21
+ [tool.black] # automatically generated by pysen
22
+ # pysen ignores and overwrites any modifications
23
+ line-length = 88
24
+ target-version = ["py311"]
25
+
26
+ [tool.isort] # automatically generated by pysen
27
+ # pysen ignores and overwrites any modifications
28
+ default_section = "THIRDPARTY"
29
+ ensure_newline_before_comments = true
30
+ force_grid_wrap = 0
31
+ force_single_line = false
32
+ include_trailing_comma = true
33
+ known_first_party = ["voicevox_engine"]
34
+ known_third_party = ["numpy"]
35
+ line_length = 88
36
+ multi_line_output = 3
37
+ use_parentheses = true
38
+
39
+ [tool.typos.default.extend-words]
40
+ datas = "datas" # PyInstaller's argument
41
+
42
+ [tool.poetry]
43
+ package-mode = false
44
+
45
+ [tool.poetry.dependencies]
46
+ python = "~3.11"
47
+ numpy = "^1.26.0"
48
+ fastapi-slim = "^0.111.0"
49
+ jinja2 = "^3.1.3" # NOTE: required by fastapi.templating.Jinja2Templates (fastapi-slim's unmanaged dependency)
50
+ python-multipart = "^0.0.9" # NOTE: required by fastapi.Form (fastapi-slim's unmanaged dependency)
51
+ uvicorn = "^0.29.0"
52
+ soundfile = "^0.12.1"
53
+ pyyaml = "^6.0.1"
54
+ pyworld = "^0.3.0"
55
+ pyopenjtalk = { git = "https://github.com/VOICEVOX/pyopenjtalk", rev = "b35fc89fe42948a28e33aed886ea145a51113f88" }
56
+ semver = "^3.0.0"
57
+ platformdirs = "^4.2.0"
58
+ soxr = "^0.3.6"
59
+ pydantic = "^2.7.3"
60
+ starlette = "^0.37.0"
61
+
62
+ [tool.poetry.group.dev.dependencies]
63
+ pysen = "^0.11.0"
64
+ black = "^24.4.0"
65
+ flake8-bugbear = "^24.4.26"
66
+ flake8 = "^7.0.0"
67
+ isort = "^5.13.0"
68
+ mypy = "^1.10.0"
69
+ pytest = "^8.2.0"
70
+ coveralls = "^3.2.0"
71
+ poetry = "1.8.2"
72
+ poetry-plugin-export = "^1.8.0"
73
+ httpx = "^0.27.0" # NOTE: required by fastapi.testclient.TestClient (fastapi-slim's unmanaged dependency)
74
+ syrupy = "^4.6.1"
75
+ types-pyyaml = "^6.0.12"
76
+ safety = "^3.1.0"
77
+ pip-licenses = "4.4.0" # NOTE: must be specified exactly (c.f. #1281)
78
+ pre-commit = "^2.16.0"
79
+
80
+ [tool.poetry.group.build.dependencies]
81
+ pyinstaller = "^5.13"
82
+
83
+ [build-system]
84
+ requires = ["poetry-core"]
85
+ build-backend = "poetry.core.masonry.api"
voicevox_engine/requirements-build.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ altgraph==0.17.4 ; python_version >= "3.11" and python_version < "3.12"
2
+ annotated-types==0.6.0 ; python_version >= "3.11" and python_version < "3.12"
3
+ anyio==4.3.0 ; python_version >= "3.11" and python_version < "3.12"
4
+ cffi==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
5
+ click==8.1.7 ; python_version >= "3.11" and python_version < "3.12"
6
+ colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and platform_system == "Windows"
7
+ cython==3.0.10 ; python_version >= "3.11" and python_version < "3.12"
8
+ fastapi-slim==0.111.0 ; python_version >= "3.11" and python_version < "3.12"
9
+ h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12"
10
+ idna==3.7 ; python_version >= "3.11" and python_version < "3.12"
11
+ jinja2==3.1.4 ; python_version >= "3.11" and python_version < "3.12"
12
+ macholib==1.16.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "darwin"
13
+ markupsafe==2.1.5 ; python_version >= "3.11" and python_version < "3.12"
14
+ numpy==1.26.4 ; python_version >= "3.11" and python_version < "3.12"
15
+ packaging==24.0 ; python_version >= "3.11" and python_version < "3.12"
16
+ pefile==2023.2.7 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
17
+ platformdirs==4.2.2 ; python_version >= "3.11" and python_version < "3.12"
18
+ pycparser==2.22 ; python_version >= "3.11" and python_version < "3.12"
19
+ pydantic-core==2.18.4 ; python_version >= "3.11" and python_version < "3.12"
20
+ pydantic==2.7.3 ; python_version >= "3.11" and python_version < "3.12"
21
+ pyinstaller-hooks-contrib==2024.6 ; python_version >= "3.11" and python_version < "3.12"
22
+ pyinstaller==5.13.2 ; python_version >= "3.11" and python_version < "3.12"
23
+ pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12"
24
+ python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "3.12"
25
+ pywin32-ctypes==0.2.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
26
+ pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12"
27
+ pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12"
28
+ semver==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
29
+ setuptools==69.5.1 ; python_version >= "3.11" and python_version < "3.12"
30
+ six==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
31
+ sniffio==1.3.1 ; python_version >= "3.11" and python_version < "3.12"
32
+ soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12"
33
+ soxr==0.3.7 ; python_version >= "3.11" and python_version < "3.12"
34
+ starlette==0.37.2 ; python_version >= "3.11" and python_version < "3.12"
35
+ tqdm==4.66.4 ; python_version >= "3.11" and python_version < "3.12"
36
+ typing-extensions==4.11.0 ; python_version >= "3.11" and python_version < "3.12"
37
+ uvicorn==0.29.0 ; python_version >= "3.11" and python_version < "3.12"
voicevox_engine/requirements-dev.txt ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ annotated-types==0.6.0 ; python_version >= "3.11" and python_version < "3.12"
2
+ anyio==4.3.0 ; python_version >= "3.11" and python_version < "3.12"
3
+ attrs==23.2.0 ; python_version >= "3.11" and python_version < "3.12"
4
+ authlib==1.3.0 ; python_version >= "3.11" and python_version < "3.12"
5
+ black==24.4.2 ; python_version >= "3.11" and python_version < "3.12"
6
+ build==1.2.1 ; python_version >= "3.11" and python_version < "3.12"
7
+ cachecontrol[filecache]==0.14.0 ; python_version >= "3.11" and python_version < "3.12"
8
+ certifi==2024.2.2 ; python_version >= "3.11" and python_version < "3.12"
9
+ cffi==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
10
+ cfgv==3.4.0 ; python_version >= "3.11" and python_version < "3.12"
11
+ charset-normalizer==3.3.2 ; python_version >= "3.11" and python_version < "3.12"
12
+ cleo==2.1.0 ; python_version >= "3.11" and python_version < "3.12"
13
+ click==8.1.7 ; python_version >= "3.11" and python_version < "3.12"
14
+ colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and (sys_platform == "win32" or platform_system == "Windows" or os_name == "nt")
15
+ colorlog==4.8.0 ; python_version >= "3.11" and python_version < "3.12"
16
+ coverage==6.5.0 ; python_version >= "3.11" and python_version < "3.12"
17
+ coveralls==3.3.1 ; python_version >= "3.11" and python_version < "3.12"
18
+ crashtest==0.4.1 ; python_version >= "3.11" and python_version < "3.12"
19
+ cryptography==42.0.7 ; python_version >= "3.11" and python_version < "3.12"
20
+ cython==3.0.10 ; python_version >= "3.11" and python_version < "3.12"
21
+ dacite==1.8.1 ; python_version >= "3.11" and python_version < "3.12"
22
+ distlib==0.3.8 ; python_version >= "3.11" and python_version < "3.12"
23
+ docopt==0.6.2 ; python_version >= "3.11" and python_version < "3.12"
24
+ dparse==0.6.4b0 ; python_version >= "3.11" and python_version < "3.12"
25
+ dulwich==0.21.7 ; python_version >= "3.11" and python_version < "3.12"
26
+ fastapi-slim==0.111.0 ; python_version >= "3.11" and python_version < "3.12"
27
+ fastjsonschema==2.19.1 ; python_version >= "3.11" and python_version < "3.12"
28
+ filelock==3.14.0 ; python_version >= "3.11" and python_version < "3.12"
29
+ flake8-bugbear==24.4.26 ; python_version >= "3.11" and python_version < "3.12"
30
+ flake8==7.0.0 ; python_version >= "3.11" and python_version < "3.12"
31
+ gitdb==4.0.11 ; python_version >= "3.11" and python_version < "3.12"
32
+ gitpython==3.1.43 ; python_version >= "3.11" and python_version < "3.12"
33
+ h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12"
34
+ httpcore==1.0.5 ; python_version >= "3.11" and python_version < "3.12"
35
+ httpx==0.27.0 ; python_version >= "3.11" and python_version < "3.12"
36
+ identify==2.5.36 ; python_version >= "3.11" and python_version < "3.12"
37
+ idna==3.7 ; python_version >= "3.11" and python_version < "3.12"
38
+ importlib-metadata==7.1.0 ; python_version >= "3.11" and python_version < "3.12"
39
+ iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "3.12"
40
+ installer==0.7.0 ; python_version >= "3.11" and python_version < "3.12"
41
+ isort==5.13.2 ; python_version >= "3.11" and python_version < "3.12"
42
+ jaraco-classes==3.4.0 ; python_version >= "3.11" and python_version < "3.12"
43
+ jeepney==0.8.0 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux"
44
+ jinja2==3.1.4 ; python_version >= "3.11" and python_version < "3.12"
45
+ keyring==24.3.1 ; python_version >= "3.11" and python_version < "3.12"
46
+ markdown-it-py==3.0.0 ; python_version >= "3.11" and python_version < "3.12"
47
+ markupsafe==2.1.5 ; python_version >= "3.11" and python_version < "3.12"
48
+ marshmallow==3.21.2 ; python_version >= "3.11" and python_version < "3.12"
49
+ mccabe==0.7.0 ; python_version >= "3.11" and python_version < "3.12"
50
+ mdurl==0.1.2 ; python_version >= "3.11" and python_version < "3.12"
51
+ more-itertools==10.2.0 ; python_version >= "3.11" and python_version < "3.12"
52
+ msgpack==1.0.8 ; python_version >= "3.11" and python_version < "3.12"
53
+ mypy-extensions==1.0.0 ; python_version >= "3.11" and python_version < "3.12"
54
+ mypy==1.10.0 ; python_version >= "3.11" and python_version < "3.12"
55
+ nodeenv==1.8.0 ; python_version >= "3.11" and python_version < "3.12"
56
+ numpy==1.26.4 ; python_version >= "3.11" and python_version < "3.12"
57
+ packaging==24.0 ; python_version >= "3.11" and python_version < "3.12"
58
+ pathspec==0.12.1 ; python_version >= "3.11" and python_version < "3.12"
59
+ pexpect==4.9.0 ; python_version >= "3.11" and python_version < "3.12"
60
+ pip-licenses==4.4.0 ; python_version >= "3.11" and python_version < "3.12"
61
+ pkginfo==1.10.0 ; python_version >= "3.11" and python_version < "3.12"
62
+ platformdirs==4.2.2 ; python_version >= "3.11" and python_version < "3.12"
63
+ pluggy==1.5.0 ; python_version >= "3.11" and python_version < "3.12"
64
+ poetry-core==1.9.0 ; python_version >= "3.11" and python_version < "3.12"
65
+ poetry-plugin-export==1.8.0 ; python_version >= "3.11" and python_version < "3.12"
66
+ poetry==1.8.2 ; python_version >= "3.11" and python_version < "3.12"
67
+ pre-commit==2.21.0 ; python_version >= "3.11" and python_version < "3.12"
68
+ prettytable==3.10.0 ; python_version >= "3.11" and python_version < "3.12"
69
+ ptyprocess==0.7.0 ; python_version >= "3.11" and python_version < "3.12"
70
+ pycodestyle==2.11.1 ; python_version >= "3.11" and python_version < "3.12"
71
+ pycparser==2.22 ; python_version >= "3.11" and python_version < "3.12"
72
+ pydantic-core==2.18.4 ; python_version >= "3.11" and python_version < "3.12"
73
+ pydantic==2.7.3 ; python_version >= "3.11" and python_version < "3.12"
74
+ pyflakes==3.2.0 ; python_version >= "3.11" and python_version < "3.12"
75
+ pygments==2.18.0 ; python_version >= "3.11" and python_version < "3.12"
76
+ pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12"
77
+ pyproject-hooks==1.1.0 ; python_version >= "3.11" and python_version < "3.12"
78
+ pysen==0.11.0 ; python_version >= "3.11" and python_version < "3.12"
79
+ pytest==8.2.0 ; python_version >= "3.11" and python_version < "3.12"
80
+ python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "3.12"
81
+ pywin32-ctypes==0.2.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
82
+ pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12"
83
+ pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12"
84
+ rapidfuzz==3.9.0 ; python_version >= "3.11" and python_version < "3.12"
85
+ requests-toolbelt==1.0.0 ; python_version >= "3.11" and python_version < "3.12"
86
+ requests==2.31.0 ; python_version >= "3.11" and python_version < "3.12"
87
+ rich==13.7.1 ; python_version >= "3.11" and python_version < "3.12"
88
+ ruamel-yaml-clib==0.2.8 ; platform_python_implementation == "CPython" and python_version < "3.12" and python_version >= "3.11"
89
+ ruamel-yaml==0.18.6 ; python_version >= "3.11" and python_version < "3.12"
90
+ safety-schemas==0.0.2 ; python_version >= "3.11" and python_version < "3.12"
91
+ safety==3.2.0 ; python_version >= "3.11" and python_version < "3.12"
92
+ secretstorage==3.3.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux"
93
+ semver==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
94
+ setuptools==69.5.1 ; python_version >= "3.11" and python_version < "3.12"
95
+ shellingham==1.5.4 ; python_version >= "3.11" and python_version < "3.12"
96
+ six==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
97
+ smmap==5.0.1 ; python_version >= "3.11" and python_version < "3.12"
98
+ sniffio==1.3.1 ; python_version >= "3.11" and python_version < "3.12"
99
+ soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12"
100
+ soxr==0.3.7 ; python_version >= "3.11" and python_version < "3.12"
101
+ starlette==0.37.2 ; python_version >= "3.11" and python_version < "3.12"
102
+ syrupy==4.6.1 ; python_version >= "3.11" and python_version < "3.12"
103
+ tomlkit==0.12.5 ; python_version >= "3.11" and python_version < "3.12"
104
+ tqdm==4.66.4 ; python_version >= "3.11" and python_version < "3.12"
105
+ trove-classifiers==2024.4.10 ; python_version >= "3.11" and python_version < "3.12"
106
+ typer==0.12.3 ; python_version >= "3.11" and python_version < "3.12"
107
+ types-pyyaml==6.0.12.20240311 ; python_version >= "3.11" and python_version < "3.12"
108
+ typing-extensions==4.11.0 ; python_version >= "3.11" and python_version < "3.12"
109
+ unidiff==0.7.5 ; python_version >= "3.11" and python_version < "3.12"
110
+ urllib3==2.2.1 ; python_version >= "3.11" and python_version < "3.12"
111
+ uvicorn==0.29.0 ; python_version >= "3.11" and python_version < "3.12"
112
+ virtualenv==20.26.2 ; python_version >= "3.11" and python_version < "3.12"
113
+ wcwidth==0.2.13 ; python_version >= "3.11" and python_version < "3.12"
114
+ xattr==1.1.0 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "darwin"
115
+ zipp==3.18.1 ; python_version >= "3.11" and python_version < "3.12"
voicevox_engine/requirements.txt ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ annotated-types==0.6.0 ; python_version >= "3.11" and python_version < "3.12"
2
+ anyio==4.3.0 ; python_version >= "3.11" and python_version < "3.12"
3
+ cffi==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
4
+ click==8.1.7 ; python_version >= "3.11" and python_version < "3.12"
5
+ colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and platform_system == "Windows"
6
+ cython==3.0.10 ; python_version >= "3.11" and python_version < "3.12"
7
+ fastapi-slim==0.111.0 ; python_version >= "3.11" and python_version < "3.12"
8
+ h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12"
9
+ idna==3.7 ; python_version >= "3.11" and python_version < "3.12"
10
+ jinja2==3.1.4 ; python_version >= "3.11" and python_version < "3.12"
11
+ markupsafe==2.1.5 ; python_version >= "3.11" and python_version < "3.12"
12
+ numpy==1.26.4 ; python_version >= "3.11" and python_version < "3.12"
13
+ platformdirs==4.2.2 ; python_version >= "3.11" and python_version < "3.12"
14
+ pycparser==2.22 ; python_version >= "3.11" and python_version < "3.12"
15
+ pydantic-core==2.18.4 ; python_version >= "3.11" and python_version < "3.12"
16
+ pydantic==2.7.3 ; python_version >= "3.11" and python_version < "3.12"
17
+ pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12"
18
+ python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "3.12"
19
+ pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12"
20
+ pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12"
21
+ semver==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
22
+ six==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
23
+ sniffio==1.3.1 ; python_version >= "3.11" and python_version < "3.12"
24
+ soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12"
25
+ soxr==0.3.7 ; python_version >= "3.11" and python_version < "3.12"
26
+ starlette==0.37.2 ; python_version >= "3.11" and python_version < "3.12"
27
+ tqdm==4.66.4 ; python_version >= "3.11" and python_version < "3.12"
28
+ typing-extensions==4.11.0 ; python_version >= "3.11" and python_version < "3.12"
29
+ uvicorn==0.29.0 ; python_version >= "3.11" and python_version < "3.12"
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/icons/8.png ADDED
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/metas.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "supported_features": { "permitted_synthesis_morphing": "NOTHING" }
3
+ }
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/policy.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ dummy3 policy
2
+
3
+ https://voicevox.hiroshiba.jp/
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/portrait.png ADDED
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/portraits/8.png ADDED
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_001.wav ADDED
Binary file (153 kB). View file
 
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_002.wav ADDED
Binary file (206 kB). View file
 
voicevox_engine/resources/character_info/35b2c544-660e-401e-b503-0e14c635303a/voice_samples/8_003.wav ADDED
Binary file (168 kB). View file
 
voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/1.png ADDED
voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/3.png ADDED
voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/5.png ADDED
voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/icons/7.png ADDED
voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/metas.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "supported_features": { "permitted_synthesis_morphing": "SELF_ONLY" }
3
+ }
voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/policy.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ dummy2 policy
2
+
3
+ https://voicevox.hiroshiba.jp/
voicevox_engine/resources/character_info/388f246b-8c41-4ac1-8e2d-5d79f3ff56d9/portrait.png ADDED