Fix validation regex for voice
This fails for "fil-PH-AngeloNeural," make it more future proof by accepting 2 or more of the same group. Signed-off-by: rany2 <rany2@riseup.net>
This commit is contained in:
@@ -248,11 +248,12 @@ class Communicate:
|
|||||||
# Possible values for voice are:
|
# Possible values for voice are:
|
||||||
# - Microsoft Server Speech Text to Speech Voice (cy-GB, NiaNeural)
|
# - Microsoft Server Speech Text to Speech Voice (cy-GB, NiaNeural)
|
||||||
# - cy-GB-NiaNeural
|
# - cy-GB-NiaNeural
|
||||||
|
# - fil-PH-AngeloNeural
|
||||||
# Always send the first variant as that is what Microsoft Edge does.
|
# Always send the first variant as that is what Microsoft Edge does.
|
||||||
if not isinstance(voice, str):
|
if not isinstance(voice, str):
|
||||||
raise TypeError("voice must be str")
|
raise TypeError("voice must be str")
|
||||||
self.voice: str = voice
|
self.voice: str = voice
|
||||||
match = re.match(r"^([a-z]{2})-([A-Z]{2})-(.+Neural)$", voice)
|
match = re.match(r"^([a-z]{2,})-([A-Z]{2,})-(.+Neural)$", voice)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
lang = match.group(1)
|
lang = match.group(1)
|
||||||
region = match.group(2)
|
region = match.group(2)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
"""Edge TTS version information."""
|
"""Edge TTS version information."""
|
||||||
|
|
||||||
__version__ = "6.1.6"
|
__version__ = "6.1.7"
|
||||||
__version_info__ = tuple(int(num) for num in __version__.split("."))
|
__version_info__ = tuple(int(num) for num in __version__.split("."))
|
||||||
|
|||||||
Reference in New Issue
Block a user