首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >bixby:音频播放器,如何向音频播放器提供输入

问bixby:音频播放器,如何向音频播放器提供输入
EN

Stack Overflow用户
提问于 2019-06-19 00:22:39
回答 1查看 106关注 0票数 0

我已经下载了示例封装,并将其实现到我的封装中,它正在工作,但现在我需要传递几个it并为歌曲生成内容。

所以我对followup的意图是

代码语言:javascript
复制
intent{
    goal:PlaySongs
    value-set:MultipleArtistId{$expr(singleArtistEvent.artistId)}
}

我的PlaySongs操作文件如下所示

代码语言:javascript
复制
action (PlaySongs) {
  type (Search)
  collect {
     computed-input (songToPlay) {
       description (Create the playlist to play)
       type (audioPlayer.AudioInfo)
       min (Required) max (One)
       compute {
       intent {
          goal: GetMeArtistSong
          value-set: MultipleArtistId
       }
    }
  hidden     
}

computed-input (play) {
    description (By passing in the AudioInfo object to the PlayAudio action, we ask the client to play our sound.)
    type (audioPlayer.Result)
    compute {
       intent {
         goal: audioPlayer.PlayAudio
         value: $expr(songToPlay)
       }
    }
    hidden
  }
}
  output (Result)
}

GetMeArtistSong操作文件如下所示

代码语言:javascript
复制
action (GetMeArtistSong) {
  type(Search)
  description (Artist Song)
  collect {
    input (artistId) {
    type (MultipleArtistId)
    min (Optional) max (One) 
  }
}
output (audioPlayer.AudioInfo)
}

我无法在GetMeArtistSong js文件中获取艺术家id。我做错了什么?隐藏是为了什么呢?请解释一下。

EN

回答 1

Stack Overflow用户

发布于 2019-06-20 02:09:23

  1. hidden意味着链接的JS函数不需要将该输入作为参数列出。如果没有hidden,您的JS函数需要同时使用songsToPlay和play作为参数。
  2. 没有实际的JS文件和端点文件,我只能推测您关于artistId的问题。它不应该与音频播放器相关。检查端点并执行console.log(),我的感觉是操作模型和JS函数没有正确链接。此外,您可能希望更改为min(Required)以强制输入。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56653361

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档