I am finally getting around to trying the new overlay feature for Sonos to streamline my announcements and cannot get it to work. I start a playlist on Sonos (Youtube Music, Plex, etc.) and when I play the announcement the playlist stops and does not overlay the announcement over the music. The announcement plays fine but the playlist stops. Any ideas? Below is a sample script.
service: media_player.play_media
data:
media_content_id: media-source://tts/google_translate?message="I am very loud"
media_content_type: music
announce: true
extra:
volume: 80
target:
entity_id: media_player.great_room
I am beginning to wonder if the Sonos speakers need the be the latest generation. Currently, mine are all S1 generation. I have a Play 5, a Play 3 and an IKEA Symfonisk. Does this new feature require S2 speakers?
I have a mix of S1 and S2 devices and use the following for them all, when executed is lowers the volume of what is currently playing and plays the message on top. I happen to be using google cloud but the same works regardless of the TTS service.
service: tts.google_cloud_say
data:
entity_id: media_player.sonoslivingroom
message: test message
I figured out what the problem was. All three of my speakers were running the S1 OS firmware. The Play 3 and the Symfonisk both support the S2 OS so I updated them both and now everything works as advertised. I hope this can help someone else if the future. The documentation should be updated to note this.
BTW is anyone using the Chimes TTS HACs integration for announcements? It works great with the main feature being combining a sound effect with TTS before sending it to the media device. The only thing I am surprised it doesnāt support is sending to multiple speaker entities at once.
Yeah, but then the point of using HA to group/ungroup based on presence is lost in my case.
Was hoping not to fiddle with the Sonos app.
I can play media, etc to all speakers right now so the tts announcement should have been possible in the same mannerā¦
Btw. Iām unsing the mediaplayer join and unjoin function (and the speakers do group in the sonos app)
The developer who maintains the Sonos integration implemented support for announce in version 2023.5.0 and hereās jjlawrenās description of the feature:
The new announce behavior avoids the need to snapshot/regroup/etc and will play over any currently playing music without interruption.
The tradeoff is that you need to explicitly target all rooms/speakers where youād like the announcement to play and they are called individually, so audio playback may not be perfectly synced.
tl;dr
Sonos announce feature doesnāt currently support playing to all members of a grouped set of speakers.
NOTE
Itās my understanding that if the target speaker is a stereo pair, the announcement will only play via one of the paired speakers.
Be advised that the difference between your example and whatās in the first post is that theadlee is using the optional volume property. The documentation warns that it may not be supported on S1 speakers
The documentation already states notes it. See the screenshot I posted above.
Contact its author. I believe others have already requested this enhancement.
It would involve using the traditional snapshot/group/play/restore technique as opposed to using announce because announce doesnāt natively support prepending a sound effect (or anything else) to TTS.
FWIW, I currently use a script to do that, optionally playing a āpreambleā prior to the announcement.
I have been in contact with the Chime TTS author @Nimrod_Dolev. He has made the enhancement to support multiple speakers. He is merging the āpreambleā with the TTS into one mp3 so the announce feature still works.
theadlee indicated you will be āmerging the āpreambleā with the TTS into one mp3ā. What are you using to do that?
FWIW, in the script that I mentioned above, it plays the two MP3 files (preamble and announcements) one after the other. It waits until the preamble is finished before starting to play the announcement.
Hi @123 , I wrote a custom integration called Chime TTS which is written in Python.
It adds a new service (chime_tts.say) to Home Assistant which allows you join audio files before and/or after TTS audio to form a new local mp3 file, played in a single service call to your media_player/s without any lag.
The service is configurable, so you can do things like specify how long of a delay you want to insert between the audio and TTS, change the speed of the TTS audio, and supports the various language-specific parameters available in Google Translateās and Nabu Casaās TTS services.