Add prompts to video generation and final message in listening audios.
This commit is contained in:
@@ -36,6 +36,15 @@ def text_to_speech(text: str, file_name: str):
|
||||
VoiceId=voice
|
||||
)
|
||||
audio_segments.append(tts_response['AudioStream'].read())
|
||||
|
||||
# Add finish message
|
||||
audio_segments.append(client.synthesize_speech(
|
||||
Engine="neural",
|
||||
Text="This audio recording, for the listening exercise, has finished.",
|
||||
OutputFormat="mp3",
|
||||
VoiceId="Stephen"
|
||||
)['AudioStream'].read())
|
||||
|
||||
# Combine the audio segments into a single audio file
|
||||
combined_audio = b"".join(audio_segments)
|
||||
# Save the combined audio to a single file
|
||||
@@ -63,6 +72,15 @@ def conversation_text_to_speech(conversation: list, file_name: str):
|
||||
VoiceId=segment["voice"]
|
||||
)
|
||||
audio_segments.append(response['AudioStream'].read())
|
||||
|
||||
# Add finish message
|
||||
audio_segments.append(client.synthesize_speech(
|
||||
Engine="neural",
|
||||
Text="This audio recording, for the listening exercise, has finished.",
|
||||
OutputFormat="mp3",
|
||||
VoiceId="Stephen"
|
||||
)['AudioStream'].read())
|
||||
|
||||
# Combine the audio segments into a single audio file
|
||||
combined_audio = b"".join(audio_segments)
|
||||
# Save the combined audio to a single file
|
||||
|
||||
Reference in New Issue
Block a user