Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
feat/available_languages (#9)
Browse files Browse the repository at this point in the history
add available_languages endpoint from MycroftAI/mycroft-core#3059

improve lang configs metadata, add display_name

Co-authored-by: jarbasai <[email protected]>
  • Loading branch information
NeonJarbas and JarbasAl authored Aug 2, 2022
1 parent fceb1f2 commit 289df32
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ovos_tts_plugin_mimic2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ def viseme(self, phonemes):
visemes.append((vis, vis_dur))
return visemes

@property
def available_languages(self) -> set:
"""Return languages supported by this TTS implementation in this state
This property should be overridden by the derived class to advertise
what languages that engine supports.
Returns:
set: supported languages
"""
return set(Mimic2TTSPluginConfig.keys())

# below are helpers to split sentence in chunks that tacotron can synth
# there is a limit for 150 chars
def _preprocess_sentence(self, sentence):
Expand Down Expand Up @@ -246,8 +256,8 @@ def get_tts_class(self):

Mimic2TTSPluginConfig = {
"en-us": [
{"voice": "kusal", "gender": "male"},
{"voice": "nancy", "gender": "female"},
{"voice": "ljspeech", "gender": "female"}
{"voice": "kusal", "gender": "male", "display_name": "Kusal"},
{"voice": "nancy", "gender": "female", "display_name": "Nancy"},
{"voice": "ljspeech", "gender": "female", "display_name": "LJSpeech"}
]
}

0 comments on commit 289df32

Please sign in to comment.