質問編集履歴

2

訂正

2025/01/31 11:39

投稿

退会済みユーザー
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

誤字訂正

2025/01/30 13:46

投稿

退会済みユーザー
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
- # テキストを音声に変換してwavファイルに保存
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}.")