yosuke-i commited on
Commit
0380c08
·
verified ·
1 Parent(s): 4b896bb

Update voice_create.py

Browse files
Files changed (1) hide show
  1. voice_create.py +3 -0
voice_create.py CHANGED
@@ -48,6 +48,7 @@ def text_to_speech(input_file):
48
  ssml += f'<break time="1s"/><voice name="{row["voiceB"]}"><prosody rate="{row["speed"]}"><p>{choices_ssml}</p></prosody></voice>'
49
  ssml += '</speak>'
50
 
 
51
  # APIリクエスト用のボディ
52
  body = {
53
  "input": {"ssml": ssml},
@@ -60,7 +61,9 @@ def text_to_speech(input_file):
60
  }
61
  url = "https://texttospeech.googleapis.com/v1/text:synthesize"
62
  response = requests.post(url, headers=headers, json=body)
 
63
  response_data = response.json()
 
64
 
65
  # 音声コンテンツの取得とファイル保存
66
  if 'audioContent' in response_data:
 
48
  ssml += f'<break time="1s"/><voice name="{row["voiceB"]}"><prosody rate="{row["speed"]}"><p>{choices_ssml}</p></prosody></voice>'
49
  ssml += '</speak>'
50
 
51
+ print(ssml)
52
  # APIリクエスト用のボディ
53
  body = {
54
  "input": {"ssml": ssml},
 
61
  }
62
  url = "https://texttospeech.googleapis.com/v1/text:synthesize"
63
  response = requests.post(url, headers=headers, json=body)
64
+ print("レスポンス",response)
65
  response_data = response.json()
66
+ print("レスポンスデータ",response_data)
67
 
68
  # 音声コンテンツの取得とファイル保存
69
  if 'audioContent' in response_data: