hifiberry / hifiberry-os

Linux distribution optimized for audio playback
MIT License
958 stars 123 forks source link

Feature Request: Create Notification/Announce function #518

Closed hanneshier closed 4 months ago

hanneshier commented 4 months ago

DO NOT remove the blocks below, but fill these with the requested data. Incomplete feature requests will be closed. You should remove this comment before posting the feature request.

Is your feature request related to a problem? Please describe. I want my Hifiberry system to announce Events in my Smart Home (in my Case: Home Assistant). But when I play the TextToSpeech Announcement to Hifiberry, the currently playing session is destroyed. If the media input comes from a Home Assistant controllable Source, I can save the media state and start the session again. But when my input source is for example AirPlay or Spotify Connect, I cannot continue playing the previously playing media.

Describe the solution you'd like I would like to have a function and an API call, where I can add a secondary DLNA input source. When there is a stream detected on the second input source, the currently playing session should be paused or muted and the secondary input source should play. When the secondary input stops, the primary media should start playing again.

Describe alternatives you've considered This might be achieved with a custom docker container, but I´m not sure, if and how this can overwrite the Hifiberry Output without destroying the session.

Additional context This might also be useful for using a hifiberry device as a voice satellite and turning it into a local voice assistant.

hifiberry commented 4 months ago

Players in HiFiBerryOS have exclusive access to the sound hardware. This is crucial to make sure no resampling and sample format conversion is done. Therefore, only the active player can access the sound card. Therefore, it's not possible to start another player without disconnecting the active player from the sound card.