Skip to content

fix(stage-ui): cosyvoice SSML support - #576

Merged
nekomeowww merged 1 commit into
moeru-ai:mainfrom
yanghui1-arch:fix/570
Sep 11, 2025
Merged

nekomeowww merged 1 commit into
moeru-ai:mainfrom
yanghui1-arch:fix/570

Conversation

@yanghui1-arch

Copy link
Copy Markdown
Contributor

Description

This PR fix SSML support of cosyvoice-v1 return value is wrong.
Previous judgement about a speech model is supported SSML by provider. However cosyvoice-v1, a speech model which is provided by alibaba, is not supported SSML. So I add a special condition to solve it and not have influence on other provider models.

Linked Issues

#567
#570

Additional Context

About alibaba provider model SSML support docs
You can search SSML标记语言支持说明

  • For later unspeech package support cosyvoice-v2 models, we need to update code to verify whether the voice supported SSML because not every voice supports it.

@netlify

netlify Bot commented Sep 11, 2025

Copy link
Copy Markdown

Deploy Preview for airi-docs failed. Why did it fail? →

Name Link
🔨 Latest commit eb40ddb
🔍 Latest deploy log https://app.netlify.com/projects/airi-docs/deploys/68c2a91b2fe7f000088be459

@netlify

netlify Bot commented Sep 11, 2025

Copy link
Copy Markdown

Deploy Preview for airi-vtuber ready!

Name Link
🔨 Latest commit eb40ddb
🔍 Latest deploy log https://app.netlify.com/projects/airi-vtuber/deploys/68c2a91b280f77000838c677
😎 Deploy Preview https://deploy-preview-576--airi-vtuber.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @yanghui1-arch, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the accuracy of SSML (Speech Synthesis Markup Language) support detection within the stage-ui module. It specifically addresses an issue where Alibaba Cloud speech models were incorrectly assumed to universally support SSML. The changes ensure that only models like cosyvoice-v2 that genuinely offer SSML capabilities are flagged as such, while others are correctly identified as not supporting it.

Highlights

  • SSML Support Refinement for Alibaba Cloud: The logic for determining SSML support has been refined for Alibaba Cloud speech models. Previously, all Alibaba Cloud models were implicitly considered to support SSML, which was incorrect for some.
  • cosyvoice-v2 SSML Enablement: Explicit support for SSML has been added for the cosyvoice-v2 model under the alibaba-cloud-model-studio provider, ensuring it is correctly identified as SSML-capable.
  • Corrected cosyvoice-v1 SSML Status: cosyvoice-v1 and other non-cosyvoice-v2 Alibaba models are now correctly identified as not supporting SSML, resolving a previous misclassification.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes an issue where cosyvoice-v1 was incorrectly reported as supporting SSML. The change introduces a specific condition for Alibaba Cloud's models, ensuring cosyvoice-v1 is excluded from SSML support while enabling it for cosyvoice-v2. My feedback includes a suggestion to refactor the logic for better readability and maintainability by grouping the conditions related to the Alibaba provider.

Comment on lines 66 to 73
const supportsSSML = computed(() => {
// Currently only ElevenLabs and some other providers support SSML
return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'alibaba-cloud-model-studio', 'volcengine'].includes(activeSpeechProvider.value)
// only part voices are support SSML in cosyvoice-v2 which is provided by alibaba
if (activeSpeechProvider.value === 'alibaba-cloud-model-studio' && activeSpeechModel.value === 'cosyvoice-v2') {
return true
}
return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'volcengine'].includes(activeSpeechProvider.value)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic is correct, but it could be restructured for better readability and maintainability. By handling the special case for the alibaba-cloud-model-studio provider first, you can make the logic for SSML support clearer. This also makes it easier to add more model-specific logic for this provider in the future.

Suggested change
const supportsSSML = computed(() => {
// Currently only ElevenLabs and some other providers support SSML
return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'alibaba-cloud-model-studio', 'volcengine'].includes(activeSpeechProvider.value)
// only part voices are support SSML in cosyvoice-v2 which is provided by alibaba
if (activeSpeechProvider.value === 'alibaba-cloud-model-studio' && activeSpeechModel.value === 'cosyvoice-v2') {
return true
}
return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'volcengine'].includes(activeSpeechProvider.value)
})
const supportsSSML = computed(() => {
// Currently only ElevenLabs and some other providers support SSML
// only part voices are support SSML in cosyvoice-v2 which is provided by alibaba
if (activeSpeechProvider.value === 'alibaba-cloud-model-studio') {
return activeSpeechModel.value === 'cosyvoice-v2'
}
return ['elevenlabs', 'microsoft-speech', 'azure-speech', 'google', 'volcengine'].includes(activeSpeechProvider.value)
})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not great because not every voice of cosyvoice-v2 supports SSML according to alibaba docs. The reason that I don't list these availiable voices is unspeech currently doesn't support cosyvoice-v2 voices. It just includes cosyvoice-v1 voice names. When unspeech supports we need to also judge whether voice of cosyvoice-v2 supports SSML.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to open a issue for unspeech for me (or you) to support the cosyvoice-v2 later.

@nekomeowww
nekomeowww merged commit e02e8c6 into moeru-ai:main Sep 11, 2025
10 of 14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants