Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Replace voice name with voice style in NCCO #44

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/examples/ncco.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Create a `talk` action to read some text into the call:
talk := ncco.TalkAction{Text: "Greetings from the golang library", VoiceName: "Nicole"}
```

or

```go
talk := ncco.TalkAction{Text: "Greetings from the golang library", Style: 0, Language: "en-US}
```

## Notify Action

Use `notify` to send a particular data payload to a nominated URL:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/voice.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func main() {

result, _, _:= client.PlayTts("aaaabbbb-0000-1111-2222-abcdef01234567",
"Hello, my friend",
vonage.PlayTtsOpts{Loop: 2, VoiceName: "Russell"}
vonage.PlayTtsOpts{Loop: 2, Style: 0, Language: "en-US"}
)
// or to stop an in-progress TTS
// result, _, _:= client.StopTts("aaaabbbb-0000-1111-2222-abcdef01234567")
Expand Down
2 changes: 2 additions & 0 deletions ncco/ncco.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type TalkAction struct {
BargeIn bool `json:"bargeIn"`
Level int `json:"level,omitempty"`
VoiceName string `json:"voiceName,omitempty"`
Style int `json:"style,omitempty"`
Language string `json:"language,omitempty"`
CalculatedLoopValue int `json:"loop"`
}

Expand Down
2 changes: 2 additions & 0 deletions voice.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ type PlayTtsOpts struct {
Loop int32
Level string
VoiceName string
Style int32
Language string
}

// PlayTts starts playing TTS into the call
Expand Down