質問編集履歴
2
訂正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
pyttsx3
|
1
|
+
pyttsx3から作成した音声ファイルが壊れてる
|
test
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
### 実現したいこと
|
2
|
-
pyttsx3
|
2
|
+
pyttsx3からテキストを音声に変換してファイル出力
|
3
3
|
|
4
4
|
### 発生している問題・分からないこと
|
5
|
-
次のプログラムを実行しても
|
5
|
+
次のプログラムを実行しても作成された音声ファイルを開くとエラーになります
|
6
6
|
|
7
7
|
import pyttsx3
|
8
8
|
|
@@ -39,7 +39,9 @@
|
|
39
39
|
- [ ] その他
|
40
40
|
|
41
41
|
##### 上記の詳細・結果
|
42
|
-
音声ファイル
|
42
|
+
音声ファイルを開いた時のエラーは
|
43
|
+
File Load Error for output.wav
|
44
|
+
/workspace/jetbot/notebooks/output.wav is not UTF-8 encoded
|
43
45
|
|
44
46
|
### 補足
|
45
47
|
環境はjetbot(ubuntu)
|
1
誤字訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,13 +16,10 @@
|
|
16
16
|
# TTSエンジンを実行
|
17
17
|
engine.runAndWait()
|
18
18
|
|
19
|
-
# サンプルテキスト
|
20
19
|
text = "こんにちは、これはテキストを音声に変換するサンプルです。"
|
21
20
|
|
22
|
-
# 出力ファイル名
|
23
21
|
output_file = "output.wav"
|
24
|
-
|
25
|
-
|
22
|
+
|
26
23
|
text_to_speech(text, output_file)
|
27
24
|
|
28
25
|
print(f"The text has been converted to speech and saved as {output_file}.")
|