Skip to content

Commit 0600855

Browse files
feat(stt-tts): generation release changes
1 parent 0ea3ac0 commit 0600855

File tree

7 files changed

+3231
-637
lines changed

7 files changed

+3231
-637
lines changed

ibm_watson/speech_to_text_v1.py

Lines changed: 296 additions & 111 deletions
Large diffs are not rendered by default.

ibm_watson/speech_to_text_v1_adapter.py

Lines changed: 220 additions & 183 deletions
Large diffs are not rendered by default.

ibm_watson/text_to_speech_v1.py

Lines changed: 1449 additions & 74 deletions
Large diffs are not rendered by default.

resources/tts_audio.wav

74 KB
Binary file not shown.

test/integration/test_text_to_speech_v1.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,35 @@ def test_custom_words(self):
7272
'MACLs').get_result()
7373
assert word['translation'] == 'mackles'
7474

75+
def test_custom_prompts(self):
76+
customization_id = self.created_customization.get('customization_id')
77+
prompt_id = "Hello"
78+
metadata = {
79+
"prompt_text": "Hello how are you today?"
80+
}
81+
82+
with open("resources/tts_audio.wav", "rb") as audio_file:
83+
self.text_to_speech.add_custom_prompt(
84+
customization_id, prompt_id, metadata, audio_file
85+
).get_result()
86+
prompts = self.text_to_speech.list_custom_prompts(customization_id).get_result()
87+
assert len(prompts) > 0
88+
prompt = self.text_to_speech.get_custom_prompt(customization_id, prompt_id).get_result()
89+
assert prompt["prompt_id"] == prompt_id
90+
self.text_to_speech.delete_custom_prompt(customization_id, prompt_id)
91+
92+
def test_speaker_models(self):
93+
speaker_name = "Angelo"
94+
95+
with open("resources/tts_audio.wav", "rb") as audio_file:
96+
speaker_id = self.text_to_speech.create_speaker_model(
97+
speaker_name, audio_file
98+
).get_result()["speaker_id"]
99+
speaker_models = self.text_to_speech.list_speaker_models().get_result()
100+
assert len(speaker_models) > 0
101+
speaker_model = self.text_to_speech.get_speaker_model(speaker_id).get_result()
102+
self.text_to_speech.delete_speaker_model(speaker_id)
103+
75104
def test_synthesize_using_websocket(self):
76105
file = 'tongue_twister.wav'
77106

test/unit/test_speech_to_text_v1.py

Lines changed: 196 additions & 187 deletions
Large diffs are not rendered by default.

test/unit/test_text_to_speech_v1.py

Lines changed: 1041 additions & 82 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)