question

newuser-c274b8a5-efd6-4097-bae2-6dc98a58f71f avatar image

About, Alexa Audio Error on skills

Echo dot software version: 613507720 (2018.07.30 17:37 seems to be the latest as of now), With audio skill, not immediately at the end of the mp3 file set for the device, immediately after 1 second, etc. "PlaybackNearlyFinished" is returned to the skill, so based on the "playbackNearlyFinished" command With skill, try again to play from the beginning (0 seconds) of audio content, notify the device . However, after that, we receive "playbackNearlyFinished" with skill one second after echo dot, I will repeat 1 second of audio forever. In Japan's audio skills, other than our company, the audio skill which is carrying out repeat processing It does not exist because it does not exist. It is also our main skill, we are considerably struggling. Could you tell me how to deal with it? * Temporarily, skills not to repeat will be subject to review. In addition, it does not occur with Echo Spot (software version: 613508820).

alexa skills kitaudioplayer
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jenn@amazon avatar image
Jenn@amazon answered

How long are the audio files? The AudioPlayer Interface is intended for longer length audio content, like podcasts, music tracks, etc.

The intention of the the PlaybackNearlyFinished is to let the skill know the device is ready to add the next stream in the queue.

If the audio track is too short (less than 15 secs), there isn't time for the skill to respond with the next track and the device to add it to the playback queue before the previous track ends.

3 comments
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi there @Jenn@amazon; you say

"If the audio track is too short (less than 15 secs), there isn't time for the skill to respond with the next track and the device to add it to the playback queue before the previous track ends."

Hmmm, so what can I do about the case where a list of tracks might contain 3x5 minute tracks, with a 15 second "intro" track in between? It just kills the playlist dead.

I've been working on this for a whole day now, trying to figure out any way round this.

For a moment, I thought that the answer might rely on some clever backend logic in response to playbackFinished however, you cannot respond with any audioPlayer directives apart from "stop" or "clearqueue" so that's no good either.

Half past midnight, and still stuck. Would really appreciate any help and ideas of how to fix this. Thanks.

0 Likes 0 ·

I've seen developers combine the Intro track with the playing track into a single audio file. Amazon Elastic Transcoder - Clip Stitching can preform this function.

Stitching together the Intro w/ the track makes a better User Experience, especially if a user says 'Alexa, Next' during the Intro track, they would expect to move to the next track and not to the track they want to skip.

0 Likes 0 ·

Hi @Jenn@amazon - thanks for the suggestion, but really looking for a fix/workaround, rather than a fudge/hack.

Also, you wrote:

"Stitching together the Intro w/ the track makes a better User Experience, especially if a user says 'Alexa, Next' during the Intro track, they would expect to move to the next track and not to the track they want to skip."

I think you meant to type makes a "poor" user experience, surely?

Let's say you have a 10 minute track, and then a 15 second track saying "in the next track, which is 10 minutes long, we discuss new techniques in cheesemaking".

There is no possible way that joining these would make a better user experience; if the intro mentions that there are 20 tracks in this edition, then joining two tracks would make the edition 19 tracks long. If the menu track mentioned that track 16 was about cheesemaking, then suddenly "jump to track 16" might land someone with an article about breadmaking. Just a really bad user experience.

Anyway, all of this is a moot point really - the thing that needs fixing is the "no indication of PlaybackNearlyFinished" bug.

Even if the track was 5 seconds long, you'd have "playback started", and then immediately "PlaybackNearlyFinished" and the player could en-queue the next item.

OR... just provide the ability to issue a "play" command in response to a "PlaybackFinished" event? I simply cannot understand why this is not permitted. I can't think what technical reason there might be.

Right now, I'm tending towards checking the duration of a track, and if it's under 20 seconds, warn that a bug in Alexa prevents playback and ask the user to say "Alexa, next", when playback stops. Again, a poor user experience that reflects badly both on Alexa and the skill.

0 Likes 0 ·
newuser-57cfdbe4-5d04-411d-90f0-eac68dba372b avatar image
newuser-57cfdbe4-5d04-411d-90f0-eac68dba372b answered

I'm having the same problem on echo dot. PlaybackNearlyFinished is returned immediately on all length of files, even the streaming ones. This wasn't happening before, so something is wrong.

(https://forums.developer.amazon.com/questions/178884/audioplayerplaybacknearlyfinished-fires-immediatel.html)

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-c274b8a5-efd6-4097-bae2-6dc98a58f71f avatar image
newuser-c274b8a5-efd6-4097-bae2-6dc98a58f71f answered

Hi Jenn, thank you so much for your reply.

The file is about 15 min long. What do you think about this long audio files?

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jonathan avatar image
Jonathan answered

Day 3 of trying to workaround this bug.

So, I can't respond to playbackstarted or playbackfinished with an ENQUEUE - in fact, the only thing I can respond to is playbacknearlyfinished, which never comes. I've been doing further testing, and files as long as nearly 30 seconds sometimes don't trigger this.

So I had one final thought. What about chaining two audioplayer commands. After all, the docs say:

> "ENQUEUE: Add the specified stream to the end of the current queue."

That wording suggests that a "queue" can consist of more than one item. However:

You can only send one Play directive in a request.

So, of course, this below fails, too.

I can't use Alexa's voice to warn the user to say "Alexa, next" as I can't respond to an audio event with TTS, and of course, my idea above of "injecting" a track saying "please say 'Alexa, next to overcome the Alexa bug with the next short track' won't work either as it in itself will be a short track.

I can't modify the source audio as I don't control it, and most of it refers to tracks by numbers in the intro.

So right now, plan D is to scan all the tracks in the playlist for length < 30 seconds, and, before the playlist starts, just say "if the playlist stops because of a bug in the player, please say Alexa next to continue". That's all I can think of right now.

Getting pretty desperate - this bug has almost blown months of work out of the water. Any ideas?!

"directives": [
				{
					"type": "AudioPlayer.Play",
					"playBehavior": "REPLACE_ALL",
					"audioItem": {
						"stream": {
							"token": "0",
							"url": "https://15-seconds.mp3",
							"offsetInMilliseconds": 0
						}
					}
				},
				{
					"type": "AudioPlayer.Play",
					"playBehavior": "ENQUEUE",
					"audioItem": {
						"stream": {
							"expectedPreviousToken": "0",
							"token": "1",
							"url": "https://15-seconds.mp3",
							"offsetInMilliseconds": 0
						}
					}
				}
			],

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anand@Amazon avatar image
Anand@Amazon answered

Hey Jonathan,

Apologies for late reply.

Do you still face this issue? If yes then, please share affected skill ID.

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-43918a89-18b4-461f-b512-ee70d1999259 avatar image
newuser-43918a89-18b4-461f-b512-ee70d1999259 answered

If audio file is less than problem threshold... We could send down a SSML tag with an AUDIO tag in it... But then we wouldn't be able to use the audioplayer feature and I believe we would lose the forward/reverse capabilities of audioplayer.

This is a HUGE issue for my project as well.

Do we have confirmation on what devices this impacts? Is it ONLY echo devices? Only dot devices? a combo, etc?

Please... Someone post some additional info.

1 comment
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello Developer,

Please share skill id to debug your issue.

0 Likes 0 ·