Hello guys, welcome to the 21st session of create custom Alexa skills using AWS lambda function tutorials for beginners. In this session we will see how to set the audio file in response There are basically two ways to sign the audio file in response first is by using SSL and another is using audio player if you just want to play any kind of sound on users request such as laughing sound after telling jokes etc. In that situation SSL is suggested along with the Alexa suppose fully featured audio player using these we can play soundtrack add into the new studied from particular offset etc. If you want to create a skill like 745 or Pandora then audio player is suggested because it will provide full control there are various predefined intense exist for audio players Such as pause and resume intent and sell intent, loop on and loop off intent.
Next and Previous intent, shuffle on and shuffle of intent. And there are three kind of directives of audio players may directive is used to start the train stopped inactive used to stop the music and clear cue directly used to clear all tracks from the queue. We will see play and stop relating in that session. Now, let us switch to Visual Studio code. Here I'm creating a new intent with name music intent. The user may say play music start music I would like to hear music in this session.
I will use ssms to play audio. In next session update this with audio player directive. That is create a new handler for music intent. I have mastered one sample mp3 file on AWS. Let us take the URL in constraint. There are several limitations for this audio file such as it should be placed on HTTPS and accessible for this I have used as And I will suggest you to upload all media files here.
Next is, is length music would be less than 90 seconds. retread for this audio must be 48 kbps and sample rate must be 16,000 hertz. If you don't know how to do this with your mp3 file then don't worry you need to download FL mpg library. This link is available in resources. open a command prompt and paste this line replace file names and it entered. Here we have used FF mpg library.
However, we can also use Audacity or Adobe Audition for that create constant for speech. I want to add some text message before our sound place so add it. Use audio tech with its source attribute pass. URL of the mp3 file. I'm adding three seconds straight between text and audio. Let us use response builder and pass speech in speech.
And we don't want to an session so use with count and session method. Register this handler Let us save it and deploy our skill. Alexa, open the second demo. Welcome to your first Alexa skill from version two SDK. I would like to hear music Here's a sound from SSL. Here I have used time tracking music of closers.
So it was played. In next session we will convert this to audio player directed. Thanks for watching this video. If you have any doubts, please feel free to contact me Have a nice day.