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

Add option to set TTS volume independently without affecting device volume #2779

Open
Pingfragger opened this issue Dec 28, 2024 · 3 comments

Comments

@Pingfragger
Copy link

Is your feature request related to a problem? Please describe.
Currently, when using Alexa Media Player for TTS (Text-to-Speech) announcements, the only way to adjust the volume is by changing the overall device volume. However, this approach has several drawbacks:

  • Alexa emits a confirmation sound whenever the volume is adjusted, which can be disruptive.
  • The volume change is persistent, meaning it affects other activities like music playback or alarms.
  • There is no way to set a temporary TTS-specific volume that applies only to announcements.

This limitation makes it difficult to manage TTS messages without impacting the user experience for other Alexa functions.

Describe the solution you'd like
I propose adding an option to set a temporary TTS-specific volume that applies only during the announcement and does not affect the device's general volume settings. This could work as:

  1. A parameter in the notify.alexa_media service (e.g., volume_tts) that sets a temporary volume for TTS.
  2. An internal mechanism that adjusts the volume for TTS playback and restores it immediately afterward without triggering Alexa's confirmation sound.

This feature would allow users to send louder or quieter TTS messages without altering the device's default playback volume.

Describe alternatives you've considered

  • Using SSML tags like <prosody volume="x-loud"> within TTS messages. However, this approach is inconsistent and not supported in all scenarios.
  • Manually adjusting the volume before and after each TTS message using automations or scripts. This method works but causes Alexa's confirmation sound and requires additional delays to ensure proper execution.

Additional context
This feature is available in OpenHAB's Echo Control Binding, where users can define a separate TTS volume that does not affect the device's actual playback settings. Implementing a similar feature in Alexa Media Player would greatly enhance its usability for Home Assistant users.

@danielbrunt57
Copy link
Collaborator

This feature is available in OpenHAB's Echo Control Binding, where users can define a separate TTS volume that does not affect the device's actual playback settings. Implementing a similar feature in Alexa Media Player would greatly enhance its usability for Home Assistant users.

That will be a substantial undertaking for someone to dissect OpenHAB's Echo Control Binding Java code and then rewrite alexapy/alexaapi.py's Python code as well as AMP!!!

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Dec 30, 2024

Have you tried using the prosidy tags?
Supported SSML tags
Controlling volume, speaking rate, and pitch

@Pingfragger
Copy link
Author

Pingfragger commented Dec 30, 2024

Thank you for your response!
I’ve already tried using the prosody tags in SSML, like this:

<speak>
  <prosody volume="x-loud">This is a test message.</prosody>
</speak>

Unfortunately, the effect of the volume attribute in Alexa is very limited. Even with x-loud or +20dB, the increase is minimal (less than 10%). It seems Alexa doesn’t fully support significant volume changes via SSML.

Currently, the only workaround is adjusting the device's hardware volume temporarily. However, this isn’t ideal as it requires extra steps outside of TTS.
If there’s a way to improve the behavior of the volume attribute in Alexa’s API or support alternatives, it would be a great addition.

Thanks again for your efforts and any further suggestions!

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