The script works but there is a very long delay, almost 1 minute, between the time I start the script and I can hear the streamed audio in my media player.
Any idea why this happens (I suspect some buffering, but 1 minute is very long) and could this be solved?
I have unlimited internet access, it would be an option (but I donāt know how to setup), that HA streams the link 24h a day and buffers in advance.
I have exactly the same problem. My delay is 45 seconds between calling the service and it playing on my Google speaker. The service to terminate the stream takes only 1-2 seconds. I am aware that the speaker can go into a āsleepā mode but this delay occurs even when repeatedly triggered.
Can anyone provide some guidance on how to fix this issue or a reason behind the delay.
I get this with some streams but not others. I have read that if you request the stream a second time it generally will start playing basically immediately but I havenāt bothered to test it myself.
I tried running it in a second time but made no difference. What I have since discovered is the wait time between 2 devices that are both set up in the service are quite different. In the bedroom I have a Lenova Clock Essential device and in the kitchen a standard Google Home Mini. The Lenova fires up within 10-15 seconds whereas the nest is the one taking 45 seconds.
Itās stinks when I try to impress my friends with this functionality, and they can simply say āOK Google, Play KEXP on Living Roomā, and it happens instantly.
I have this issue also when trying to stream any radio stations on my Google nest mini vĆa radio browser, sometimes it wonāt load at all, some others will take almost a minute.
But this is still the Google device having to link to an internet radio stream URL rather than hitting the Google server to stream music or your in-house device to stream locally.
I also get a approx 30 second delay from time stream is called to it playing audibly on the Google Home mini speaker.
Iām guessing this is a Google Home issue rather than HA but would be good to know if there are any workarounds/hacks for it to audibly play the stream instantly
Itās the same here and Iām not using Google, but LMS server and media player.
Sometimes the first load stops and when I start again it loads almost immediately.
So I donāt think itās Googleās problem.
Pretty sure you want media_content_type: āaudio/mpegā not music to indicate itās a stream.
Otherwise (Iām guessing) it treats it as a file to be downloaded and downloads as much as it can before it starts playing. If it was a non-stream URL (e.g. a link to a mp3) it would download the file very fast and start playing it.
There is an extra: element which has an option:
stream_type string (optional)
Describes the type of media artifact as one of the following: NONE, BUFFERED, LIVE.
That might work as well, but I know at least the first method works fine with my BluOS players.