Alexa audioPlayer

amazon-alexa

#1

HI,

When Alexa play the song he left the application

This is my code
Screenshot_3


#2

Hello I think is because you are using tell that ends the session. Try using ask


#3

Yes but with ask he stop the music and he waits for me to speak


#4

Can you tell me what you want to achieve? You might need to modify the user flow to achieve what you need


#5

When the song play I want him to announce the sound


#6

So if I understand correctly,

The user says the title,

Alexa tells is starting to play the audio
play the audio
Application exit.

Is this what you need? then your code should be fine.
Are you sure the audio url is reachable?
Have you check that your audio is conform to alexa specs?

https://developer.amazon.com/docs/custom-skills/audioplayer-interface-reference.html

If you do not want the application to exit after the song is played then you should not end the session
and you should navigate to another state or intent or both after it


#7

Yes it’s this, the song continue but he stop the application this is the request json :
https://code.empreintesduweb.com/13534.html


#8

What do you mean with it stops the application? Does it start playing the audio but then the audio suddenly stops?

I can see in your request that it contains the AudioPlayer.PlaybackStarted, so this should work.

Please keep in mind that the audio player interface always closes the session after starting the audio playback.


#9

The audio continue this is good but close the application.

“Please keep in mind that the audio player interface always closes the session after starting the audio playback.”
Ok and how can I keep the session open ?

Because with google assistance I don’t have this problem


#10

You can’t if you’re using the AudioPlayer Interface.

You could also play audio with SSML (this.$speech.addAudio('https://...')) but it has lower audio quality.


#11

Damage thanks anyway !


#12

I tested two application “skyrock” and “fun radio”.
When the song start the app no stop


#13

And in “Project 3: Build a Podcast Player” the application no stop


#14

someone would solve the problem ?