jjlawren / sonos_cloud

Sonos cloud API integration for Home Assistant with improved TTS/alerts handling
121 stars 5 forks source link

Currently playing music pauses while tts plays #16

Closed mathieu-mp closed 2 years ago

mathieu-mp commented 2 years ago

Hi,

Using service.microsoft_play on the media_player entity created by sonos_cloud, currently playing musics pauses while TTS is played.

It doesn't fit the description displayed in the README: "Audio played in this manner will reduce the volume of currently playing music, play the clip on top of the music, and then automatically return the music to its original volume." This happens while playing on radio or spotify, I haven't tested with other streams.

Sonos player is Play:1 => SonosOS: S2 / Version: 13.4.1 / Hardware version: 1.20.1.6-2.1

jjlawren commented 2 years ago

Can you confirm the specific service call you're using (e.g., tts.say_microsoft?), and that the media_player entity passed in is definitely the sonos_cloud one? When using this custom component there are duplicate entities for each speaker.

Perhaps also try with the built-in CHIME as described in the instructions to see how it behaves.

mathieu-mp commented 2 years ago

Thank you for your answer.

Following your message, I do confirm that I use the sonos_cloud media_player entity. I also just tried with tts.microsoft_say, tts.google_translate_say and the built-in chime, and the behavior remains the same.

jjlawren commented 2 years ago

Upon further testing, this may be a limitation on certain models. Perhaps older models are not able to mix two audio streams in realtime. For example, a One will work as the readme describes, but a Play:1 will effectively pause and resume while the alert is played.

jjlawren commented 2 years ago

Updated the documentation here to note this limitation.