How to start an Audio from a certain time

google-assistant

#1

Like the title, I would like to know if there is a way, like with Alexa (get/set offset), for playing audio at a certain time for Google Asssistant.


#2

Do you use the new Conversational Actions?

Not 100% sure, but I think it wasn’t possible with the old Google Assistant integration.

Here’s a Conversational Actions example:

this.$googleAction.$audioPlayer.playAudio({
			name: 'Media name',
			description: 'Media description',
			url: 'https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
			image: {
				large: {
					alt: 'Jazz in Paris album art',
					height: 0,
					url: 'https://storage.googleapis.com/automotive-media/album_art.jpg',
					width: 0,
				},
			},
		}, 
                 '2500ms');

#3

I had no idea of the new integrations, I have tried this one in a Github project that I have found jovotech github but I have no idea why but in the jovo run it doesn’t play the audio. Audio works on Jovo run for google assistant for conversational actions?


#4

I have tried and it doesn’t work, with the offset, without yes


#5

My, bad ms doesn’t work. You have to use s

This is what I found in the Google Assistant docs:

Seek position to start the first media track. Provide the value in seconds, with fractional seconds expressed at no more than nine decimal places, and end in the suffix “s”. For example, 3 seconds and 1 nanosecond is expressed as “3.000000001s”.


#6

Thank you, now it works but how can I do the same for an audio file that is more than 2 minutes?


#7

I tried 121s with a 4 minute file and it worked.


#8

It wasn’t an mp3 or it was? I have tried with mp3 and aac, in the second case worked, in the first one no


#9

Yes, it was a mp3 file.


#10

Note that if you want to seek farther into a standard MP3 file, with any system, there may be a considerable delay since the player has to decompress its way through the file to find that offset. I ran into that when I wanted to pause playback after half an hour, do some other things with my smartspeaker (which flushed its internal cache) and then resume playback – specifying the 30-minute offset to resume at works, but the user is left hanging for a while.

(At one point I was issuing a warning to the user if the offset was a long one, asking them to be patient while we did this seek. Unfortunately I couldn’t figure out how to distinguish the case where I was just resuming after a pause – with the audio still cached, so it could resume immediately – from the case where the cache had been flushed and we had to do the slow reload-and-scan-forward. I think Amazon’s answer is that long audio should be broken up into smaller pieces, so the forward-seek delay is never very long… or that your streaming service should keep the audio in uncompressed form, generating the compressed stream when you tell it where to start from rather than using offset playback. I can’t use either of those, unfortunately.)