Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SSML] Wrong settings used for speech synthesis #27

Open
roehrt opened this issue Nov 22, 2022 · 1 comment
Open

[SSML] Wrong settings used for speech synthesis #27

roehrt opened this issue Nov 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@roehrt
Copy link

roehrt commented Nov 22, 2022

Describe the bug
Mimic3 ignores <prosody> settings and instead applies the settings of the last closed <prosody> block instead.

To Reproduce
mimic3 '<prosody rate="200%">This should be spoken fast but is not.</prosody><prosody volume="30%">This should be a bit quieter but is actually spoken faster</prosody>' --ssml | aplay

Expected behavior
Mimic3 should speak the first sentence fast and the second one with lowered volume.

Environment
 - Device type: desktop
 - OS: Ubuntu 22.04

Source of actual behavior

mimic3/mimic3_tts/tts.py

Lines 470 to 501 in be72c18

def end_utterance(self) -> typing.Iterable[BaseResult]:
last_settings: typing.Optional[Mimic3Settings] = None
sent_phonemes: PHONEMES_LIST_TYPE = []
for result in self._results:
if isinstance(result, Mimic3Phonemes):
if result.is_utterance:
# Utterance boundary
if (
sent_phonemes
and (last_settings is not None)
and (result.current_settings != last_settings)
):
# Not compatible with existing utterance.
# Need to speak previous utterance first.
yield self._speak_sentence_phonemes(
sent_phonemes, settings=last_settings
)
sent_phonemes.clear()
# Current utterance
sent_phonemes.extend(result.phonemes)
if sent_phonemes:
yield self._speak_sentence_phonemes(
sent_phonemes, settings=last_settings
)
sent_phonemes.clear()
else:
# Continue until utterance boundary
sent_phonemes.extend(result.phonemes)
last_settings = result.current_settings

@roehrt roehrt added the bug Something isn't working label Nov 22, 2022
@stephenrt42
Copy link

stephenrt42 commented May 25, 2023

Try this;
<speak> <prosody rate="200%"><s>This should be spoken fast but is not.</s></prosody><prosody volume="30%"><s>This should be a bit quieter but is actually spoken faster</s></prosody> </speak>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants