Skip to content

Commit

Permalink
feat(stt-tts): generation release changes
Browse files Browse the repository at this point in the history
  • Loading branch information
apaparazzi0329 committed Jun 10, 2021
1 parent 0ea3ac0 commit 0600855
Show file tree
Hide file tree
Showing 7 changed files with 3,231 additions and 637 deletions.
407 changes: 296 additions & 111 deletions ibm_watson/speech_to_text_v1.py

Large diffs are not rendered by default.

403 changes: 220 additions & 183 deletions ibm_watson/speech_to_text_v1_adapter.py

Large diffs are not rendered by default.

1,523 changes: 1,449 additions & 74 deletions ibm_watson/text_to_speech_v1.py

Large diffs are not rendered by default.

Binary file added resources/tts_audio.wav
Binary file not shown.
29 changes: 29 additions & 0 deletions test/integration/test_text_to_speech_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,35 @@ def test_custom_words(self):
'MACLs').get_result()
assert word['translation'] == 'mackles'

def test_custom_prompts(self):
customization_id = self.created_customization.get('customization_id')
prompt_id = "Hello"
metadata = {
"prompt_text": "Hello how are you today?"
}

with open("resources/tts_audio.wav", "rb") as audio_file:
self.text_to_speech.add_custom_prompt(
customization_id, prompt_id, metadata, audio_file
).get_result()
prompts = self.text_to_speech.list_custom_prompts(customization_id).get_result()
assert len(prompts) > 0
prompt = self.text_to_speech.get_custom_prompt(customization_id, prompt_id).get_result()
assert prompt["prompt_id"] == prompt_id
self.text_to_speech.delete_custom_prompt(customization_id, prompt_id)

def test_speaker_models(self):
speaker_name = "Angelo"

with open("resources/tts_audio.wav", "rb") as audio_file:
speaker_id = self.text_to_speech.create_speaker_model(
speaker_name, audio_file
).get_result()["speaker_id"]
speaker_models = self.text_to_speech.list_speaker_models().get_result()
assert len(speaker_models) > 0
speaker_model = self.text_to_speech.get_speaker_model(speaker_id).get_result()
self.text_to_speech.delete_speaker_model(speaker_id)

def test_synthesize_using_websocket(self):
file = 'tongue_twister.wav'

Expand Down
383 changes: 196 additions & 187 deletions test/unit/test_speech_to_text_v1.py

Large diffs are not rendered by default.

1,123 changes: 1,041 additions & 82 deletions test/unit/test_text_to_speech_v1.py

Large diffs are not rendered by default.

0 comments on commit 0600855

Please sign in to comment.