0

I have text output that contains "--John Doe" to indicate that the source of the quotation is John Doe. Bixby is reading it as "minus John Doe". I want to read it as "pause John Doe".

I have enclosed the speech() in tags.

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

  }
}

Conversation pane in debug:

Dialog/<speak>I claim to be an average man of less than average ability. I have not the shadow of a doubt that any man or woman can achieve what I have, if he or she would make the same effort and cultivate the same hope and faith. --Mohandas Karamchand Gandhi</speak>
Template

<speak>#{value(text)}</speak>

It pronounces the -- as "minus". I want it to be a pause.

hyeon62
  • 30
  • 6
Fred Zimmerman
  • 1,178
  • 3
  • 13
  • 29

4 Answers4

2

Bixby supports limited SSML and I don't think the <break/> tag is supported yet (you could give it a try), but that is the tag you would want. Inside this tag, you can specify how long you want to break for, e.g. <break time="1s"/> or <break time="500ms"/>. So applying this to your example:

<speak>I claim to be an average man of less than average ability. I have not the shadow of a doubt that any man or woman can achieve what I have, if he or she would make the same effort and cultivate the same hope and faith. <break time="1s"/> Mohandas Karamchand Gandhi</speak>

In your action JS, you would need to have something like

let quote = 'I claim to be an average man of less than average ability. I have not the shadow of a doubt that any man or woman can achieve what I have, if he or she would make the same effort and cultivate the same hope and faith. --Mohandas Karamchand Gandhi';

quote = quote.replace('--', '<break time="1s"/>');

To replace the -- with the appropriate SSML tag.

The documentation doesn't say Bixby supports this tag yet. About a month ago, some of the Bixby staff said in Slack that more SSML support is "coming very soon", but I don't think it has arrived yet.

2

User error. Replace the two "minuses" with — (em-dash). Maybe that'll help?

Timothy Aaron
  • 3,059
  • 19
  • 22
1

There is no quick way, nor SSML would help in this case. You should use different content for display and speech.

  1. define a structure with display and speech property. TextDisplay and TextSpeech are just Text primitive concept.
structure (MyStruct) {
  property (display) {
    type (TextDisplay) min (Required) max (One)
  }
  property (speech) {
    type (TextSpeech) min (Required) max (One)
  }
}
  1. When creating such concept, make sure do the the replacement in your JS script so that myStruct.display = "xyz -- John"; and myStruct.speech = "xyz .. John";
  2. define view file, the trick is that each dot in speech will create a little pause. You can control the length of pause by adding more dots.
result-view {
  match: MyStruct(this) 
  message {
    template ("#{value(this.display)}") {
      speech ("#{value(this.speech)}")
    }
  }
}
1

If you use , reading it to be paused

like this:
template ("Hello #{value(text)}") {
  speech ("Hello。 #{value(text)}")
}

and

quote.replace() is not good,

Try to add source (property) to your Content structure.

Content.model.bxb

Structure (Content) {
  property (quote) {
    type (viv.core.Text)
    min (Require)
  }

  property (source) {
    type (viv.core.Text)
    min (Require)
  }
}

and your dialog

dialog (Result) {
  match: Content (content)
  if ($handsFree) {
    template("#{value(content.quote)} -- #{value(content.source)}") {
      speech("#{value(content.quote)} 。。 #{value(content.source)}")
    }
  }
}
hyeon62
  • 30
  • 6