question

newuser-ea5c6207-0008-4d79-9e05-deaef62b735d avatar image
newuser-ea5c6207-0008-4d79-9e05-deaef62b735d asked ·

not playing audio - anything wrong with this code?

const LaunchRequestHandler = {
  canHandle(handlerInput) {
    return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
  },
  handle(handlerInput) {
    console.log('IN LAUNCHREQUEST');

    return handlerInput.responseBuilder
    	.addDirective({
        	type: 'AudioPlayer.Play',
         	playBehavior: 'REPLACE_ALL',
         	audioItem: {
            	stream: {
            		token: "0",
            		url: "myurlhere",
            		offsetInMilliseconds: 0
            	}
            }
        })
  	}
};
alexa skills kitaudioplayersdk v2
10 |2000 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.

Amazon_Bernardo Bezerra avatar image
Amazon_Bernardo Bezerra answered ·

Hi and thank you for your message.

Are you still facing this issue? I tried the code you pasted in your message and was able to access the audio in a sample URL. Can you provide the URL you are trying to access?

Also, this doc have presents information regarding the recommended Media Support that might be of interest for you.

Regards,
Barry

10 |2000 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-5e0276d8-155a-4d9e-918e-5b570366d9b7 avatar image
newuser-5e0276d8-155a-4d9e-918e-5b570366d9b7 answered ·

Even I have the same issue, addDirective method is not working. Did anything change?

1 comment
10 |2000 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 and thanks for your interest.

Was your skill working without issues before? Are you sure that the URL you are providing meets the requirements listed here?

If so, please provide your skill ID and the URL you are trying to stream so I can take a look at it.

Regards,
Barry

0 Likes 0 ·