Support play_url with local file path with TTS #576
Replies: 3 comments 1 reply
-
This request has gotten a little traction now and it would be nice if it can be considered for further discussions at least. Implementing this would allow me to support TTS to any AirPlay 1 speaker (including HomePod) via the Apple TV integration. |
Beta Was this translation helpful? Give feedback.
-
Maybe it would be the easiest and quickest way to add a new parameter to the play_media service and call it local_path or something like that. The TTS service (and potentially others) could fill this in addition to the media_id, which should be kept as is. If an integration (like yours) wants to use the local_path, it can be taken from the kwargs. |
Beta Was this translation helpful? Give feedback.
-
One problem with passing local file path is that it (the file) isn't necessarily available when making the |
Beta Was this translation helpful? Give feedback.
-
Context
I want to support streaming audio via AirPlay in the Apple TV integration, but mainly to support TTS. The regular
play_url
usually works quite poorly and it's been broken in tvOS for a while ("things" break until the device is restarted).AirPlay uses RTP to stream and only supports local files. To steam a remote file would mean that the client first streams it downlink, potentially re-encodes it before sending it to the receiver. This would of course work (if I implemented support for it in pyatv), but it would also be kinda silly to do here since the local file is available on the file system. It's just not available to integrations.
Proposal
I see two alternatives:
play_url
service. Simple, but would be tricky to implement in a nice way in the frontend however.media_player
component, so a media player can state if it supports local files or not. The TTS component can then look at the support flag and pick file name instead of URL, if that is supported. It's not foolproof as the same situation as I have, could potentially be valid the other way around.Maybe there are better ways?
Beta Was this translation helpful? Give feedback.
All reactions