1
var Response = require('alexa-response'); 

//first intent 
LaunchRequest:function(){ 
//Type 1 gives an error saying the "response is not valid" when tested in the  developers console. 
//the Response here is an npm library 
Response.directives(
AudioPlayer.play({ url: 'https://s3.amazonaws.com/sounds226/boom.mp3' }), 
AudioPlayer.enqueue({ url: 'https://s3.amazonaws.com/sounds226/boom.mp3' }         ) .build(); 

//Type 2 : gives an error when tested on echosim.io saying that the response is not valid 
speechOutput = this.t('WELCOME_MESSAGE'); this.response.audioPlayerPlay("REPLACE_ALL",audioData[1].url).speak(speechOutput); 
this.emit(':responseReady'); 

//Type 3: tried to insert the audio tag within the speech response, error again 
speechOutput = { 
speech: "<speak>" +message+ "<audio src = 'https://s3.amazonaws.com/sounds226/boom.mp3'/></speak>", 
    type : 'SSML' 
}; 
response.ask(speechOutput); 
} 

アレクサが私のスキルを話す前に、オーディオを挿入しようとしています。音声は90秒以内です。それは間違った方法でオーディオタグを間違って理解しているか、ディレクティブを使用しているのでしょうか?前もって感謝します。アレクサオーディオの問題

https://developer.amazon.com/blogs/post/Tx1DSINBM8LUNHY/new-alexa-skills-kit-ask-feature-audio-streaming-in-alexa-skills

と明確な情報がある:

LaunchRequestまたはIntentRequestに応答するとき、あなたの応答は、両方のAudioPlayerディレクティブと標準を含むことができ、すべてのヘルプはここで

+0

- (!ないのAWSラムダテスト中)developer.amazon.comでslikkテスト]タブでは、たとえば、より厳密にチェックしてください – nvvetal

+0

あなたがスキルにセットアップ –

+0

はいを​​アマゾンであなたがオーディオプレーヤーの方向を有効にしているが、必要条件ではなかったですオーディオ指令は必要ありません。私は**オーディオサンプル**を追加する方法を見つけようとしていましたが、これは**オーディオディレクティブ**と似ていないAlexaスポークの前に再生する必要があります**。私は 'speechOutput = this.t( 'WELCOME_MESSAGE')+ '

答えて

0

が例とイントロで高く評価されoutputSpeech、card、repromptなどの応答プロパティ。 たとえば、playSpeechをPlayディレクティブと同じ応答で提供すると、オーディオのストリーミングを開始する前に、提供されたテキストがスピーチされます。

ドク - https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/custom-audioplayer-interface-reference

よりスタートプレイについて

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/custom-audioplayer-interface-reference#play

+0

私はオーディオタグの追加に問題がありましたが、次のようになります:speechOutput = this.t( 'WELCOME_MESSAGE')+ '

0

SSML応答で<audio>タグを使用する場合は、MP3ファイルは、サンプル・レート(16000)とビットレートに準拠してください(48kbps)が必要です。

More details here.

+0

@ MultiplyByZer0共有いただきありがとうございます。 – Maher

0

アレクサはそれを再生するためのオーディオ(48 kbpsにプロジェクトレート16000と品質)特定のフォーマットにエンコードする必要があります。コマンドの下に使用して、オーディオ、

のffmpegを変換してください-i -ac 2 -codec:libmp3lameの-b:あなたがいる場合は、https://www.ffmpeg.org/

から 'ffmpegの' をダウンロードすることができ48K -ar 16000

上記のコマンドを実行する前にffmegのbinフォルダにWindows CDを使用してください。 SSMLについて

関連する問題