使用Bixby,如果设备处于免提模式,我的语音输出会如何变化

时间:2019-09-06 18:34:06

标签: bixby

使用Bixby时,我知道用户是否使用“ Hi Bixby”而不是Bixby按钮,他们处于免提模式,可能看不到屏幕。如何改变语音输出以适应这种情况?

2 个答案:

答案 0 :(得分:4)

您可以使用$ handsFree EL变量或Java的$ vivContext中可用的handsFree变量来检测模式是否为免提。下面是使用EL在免提模式下显示更长/不同语音的示例代码(这是一个Dialog-可以在视图中的消息中执行相同操作)

dialog (Result) {
  match: HelpScreen
  if ($handsFree) {
    template("Help Header text") {
      speech ("Long help wording because user is hands-free")
    }} else {
    template("Help Header text") {
    }
  }
}

答案 1 :(得分:0)

我用两种不同的方式结束它-一种冗长的操作:

dialog (Result) {
  match: Content
  if ($handsFree) {
    choose (Random) {
      template ("Listen to this quote.") {
                       speech ("Listen to this quote. #{value(text)}")}
      template ("I found this quotation.") {
        speech ("I found this quotation. #{value(text)}")}
      template ("Here's a result from Unix fortune.") {
                       speech ("Here's a result from Unix fortune. #{value(text)}")}
      template ("Here's one.") {
                       speech ("Here's one. #{value(text)}")}
      template ("Here's what I found.") {
                       speech ("Here's what I found. #{value(text)}")}
      template ("Listen to this quotation.") {
                       speech ("Listen to this quotation. #{value(text)}")}
      template ("Here's one I found.") {
                       speech ("Here's one I found. #{value(text)}")}
      template ("Here's a quote.") {
                       speech ("Here's a quote. #{value(text)}")}
      template ("Here's a quotation.") {
                       speech ("Here's a quotation. #{value(text)}")}
      template ("Check this out.") {
                       speech ("Check this out. #{value(text)}")}
  }
  } else {
    choose (Random) {
      template ("Look at this quote.")
      template ("I found this quotation.")
      template ("I ran the fortune command and got this.")
      template ("Here's one.")
      template ("Here's what I found.")
      template ("Here's a good one.")
      template ("Here's one I found.")
      template ("Here's a quote.")
      template ("Here's a quotation.")
}
}
}

,另一个则更是如此:

dialog (Result) {
  match: Content
  if ($handsFree) {
      template ("\n\n") {
         speech ("<speak>#{value(text)}</speak>")
  }
  } else {
}
}