How can I set the voice of a TTS service (like specifically VoiceRSS VoiceRSS - Home Assistant )?
According to the API doc (Voice RSS - Text-to-speech (TTS) API documentation ) it is possible by adding e. g. “&v=Amy” to the HTTP GET request.
But the integration is taking care of that (encapsulates the HTTP GET request I guess) and it does not have a configuration option VoiceRSS - Home Assistant for this.
So I tried few combinations (wild guesses) for the platform-specific options when executing the service. Example:
service: tts.voicerss_say
data:
message: Test
entity_id: media_player.speaker
options: v=Amy
… which fails with error Error when executing service tts.voicerss_say. expected dict for dictionary value @ data['options']. Got None
.
Any ideas?
Find the right option syntax to select the voice
Ask the integration (GitHub feature request?) to simply provide a voice configuration variable
…?
Not sure about that integration, but it can be done with Amazon Polly . However, the voice selection is at the integration level, so you can’t readily change voices from one message to another. It supports SSML, so you can whisper, emphasise, pause etc as documented here . I have not used Polly with HA for a couple of years, but assume it’s still working ok.
e-raser
September 6, 2023, 10:22am
3
Still looking for a solution for VoiceRSS, not interested in Amazon Polly…
Is someone able to enhance the integration at
DEFAULT_CODEC = "mp3"
DEFAULT_FORMAT = "8khz_8bit_mono"
PLATFORM_SCHEMA = TTS_PLATFORM_SCHEMA.extend(
{
vol.Required(CONF_API_KEY): cv.string,
vol.Optional(CONF_LANG, default=DEFAULT_LANG): vol.In(SUPPORT_LANGUAGES),
vol.Optional(CONF_CODEC, default=DEFAULT_CODEC): vol.In(SUPPORT_CODECS),
vol.Optional(CONF_FORMAT, default=DEFAULT_FORMAT): vol.In(SUPPORT_FORMATS),
}
)
async def async_get_engine(hass, config, discovery_info=None):
"""Set up VoiceRSS TTS component."""
return VoiceRSSProvider(hass, config)
class VoiceRSSProvider(Provider):
"""The VoiceRSS speech API provider."""
by adding voices config as another config option according to “Voices” section of Voice RSS - Text-to-speech (TTS) API documentation ?
At the same time the docs at VoiceRSS - Home Assistant need to be updated to reflect this additional config option, ideally noting that the configured voice needs to match the selected language (it’s not possible to cross-mix voices with languages).
Edit: tested locally and created the necessary PRs (my first time contributing to an integration, wohoo ):
home-assistant:dev
← bcutter:patch-1
opened 04:21PM - 31 Jul 24 UTC
Allow to choose a specific voice
<!--
You are amazing! Thanks for contribu… ting to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
Allow to choose a specific voice as offered by the official API (https://www.voicerss.org/api/). Currently when selecting a language, the default voice for that language is used.
- If no voice is configured, the behaviour remains unchanged.
- If a voice is configured and it matches the configured language, that voice will be used.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [X] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/34052
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [X] The code change is tested and works locally.
- [X] Local tests pass. **Your PR cannot be merged unless tests pass**
- [X] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [X] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [X] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
home-assistant:next
← bcutter:patch-4
opened 04:45PM - 31 Jul 24 UTC
Add new voice config option
## Proposed change
<!--
Describe the big p… icture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
Document new voice config option.
## Type of change
<!--
What types of changes does your PR introduce to our documentation/website?
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR.
-->
- [ ] Spelling, grammar or other readability improvements (`current` branch).
- [ ] Adjusted missing or incorrect information in the current documentation (`current` branch).
- [ ] Added documentation for a new integration I'm adding to Home Assistant (`next` branch).
- [ ] I've opened up a PR to add logos and icons in [Brands repository](https://github.com/home-assistant/brands).
- [X] Added documentation for a new feature I'm adding to Home Assistant (`next` branch).
- [ ] Removed stale or deprecated documentation.
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- Link to parent pull request in the codebase: https://github.com/home-assistant/core/pull/122963
- Link to parent pull request in the Brands repository:
- This PR fixes or closes issue: fixes #
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [X] This PR uses the correct branch, based on one of the following:
- I made a change to the existing documentation and used the `current` branch.
- I made a change that is related to an upcoming version of Home Assistant and used the `next` branch.
- [X] The documentation follows the Home Assistant documentation [standards].
[standards]: https://developers.home-assistant.io/docs/documenting/standards
## Summary by CodeRabbit
- **New Features**
- Introduced a new optional `voice` parameter for the VoiceRSS integration, allowing users to customize the voice used in text-to-speech operations.
- Updated documentation with an example showcasing the use of the `voice` parameter for the German language ("de-de").
Edit: 3 weeks later and no one took even a look at the PRs. Well, first and probably last time filing a PR to HA Core.