playAudio - buffer

google-assistant

#1

Hi all,
I inserted an icecast link in a media object for listening to the stream of a radio. But when the user calls the intent it always takes a long time to load, the audio starts after about twenty seconds. I set the object like this:

this.$googleAction.$audioPlayer.playAudio(
{
name: titlePlayer,
description: contentPlayer,
url: _streaming,
image: {
large: {
alt: ‘Title’,
height: 0,
url: '_urlImage,
width: 0,
},
},
},
offset,
[
‘STOPPED’,
‘PAUSED’,
],
);

Is there a way to force play without having to wait for loading?
Thanks!


#2

We followed this guide (https://stackoverflow.com/questions/54252150/latency-in-mp3-live-streaming-on-google-home-assistant/67422397#67422397) and changed the burst-size parameter. In this way the player starts immediately.


#3

Good to know, thanks! We had this issue 2 years ago.

cc @dominik-meissner


#4

If this does not work (since no icecast in the mix) There is another workaround: Add a sufficient long prompt before playing the audio (eg. “Great choice! I will now start playing the audio for you. A small hint: you can pause playback anytime and next time we will catch up where you left”) will bring down buffer times from 30s to the duration of the text (~10s). Its a bit hacky but does not leave the user in a lost state. The text has to be sufficient long - too short no result. Play around with adding words.