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

[Bug Report] It appears that the Azure Python SDK currently does not support emotion settings for speech synthesis. #137

Open
HolmesShuan opened this issue Oct 1, 2024 · 1 comment

Comments

@HolmesShuan
Copy link

Hi,

I'm trying to set the voice emotion using the following code:

from RealtimeTTS import TextToAudioStream, AzureEngine

engine = AzureEngine(
    speech_key=speech_key,
    service_region=service_region,
    voice="zh-CN-XiaoxiaoMultilingualNeural",  # New voice
    rate=0
)
engine.emotion = "empathetic"
engine.emotion_degree = 1.0
engine.emotion_role = "YoungAdultFemale"

However, this doesn't seem to have any effect. I then tried using the SSML approach, and it worked perfectly. This raises the question: does the emotion setting still function in RealtimeTTS?

Here's the SSML code that worked:

ssml = f"""
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="zh-CN">
    <voice name="zh-CN-XiaoxiaoNeural">
        <mstts:express-as style="empathetic">
            {content}
        </mstts:express-as>
    </voice>
</speak>
"""

result = synthesizer.speak_ssml_async(ssml).get()
@KoljaB
Copy link
Owner

KoljaB commented Oct 1, 2024

I will check that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants