LoginSignup
7
4

More than 5 years have passed since last update.

ClovaでAudioPlayerを試してみた

Last updated at Posted at 2018-07-26

AudioPlayerでできること

URLを指定するだけで、Clovaで音声ファイルを流すことができます。
ClvoaでLINEミュージックとかを流すのをイメージしていただけるとわかりやすいかと思います。
あれを、スキルとして自由に音声ファイルを指定してあげます。

基本設定

基本設定画面の「AudioPlayerの使用」を「はい」を選択して保存します。

Clova_Developer_Center_β.png

レスポンスのJSON

urlの部分を流したい音声ファイルのURLに変更してください。

{
  "version": "1.0",
  "sessionAttributes": {},
  "response": {
    "card": {},
    "directives": [
      {
        "header": {
          "namespace": "AudioPlayer",
          "name": "Play"
        },
        "payload": {
          "audioItem": {
            "audioItemId": "hogehogeeee",
            "title": "song title",
            "artist": "artist name",
            "stream": {
              "beginAtInMilliseconds": 0,
              "token": "sample-token",
              "url": "https://something.audio.mp3",
              "urlPlayable": true
            }
          },
          "playBehavior": "REPLACE_ALL"
        }
      }
    ],
    "outputSpeech": {},
    "shouldEndSession": true
  }
}

この続き

音声ファイルの開始何秒からスタートするかなど細かな設定がまだまだたくさんできます。
詳しくは、公式ドキュメントに書いています。

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4