Class: Vonage::Voice::Talk

Inherits:
Namespace
  • Object
show all
Defined in:
lib/vonage/voice/talk.rb

Instance Method Summary collapse

Instance Method Details

#start(id, params) ⇒ Response

Play text to speech into a call.

Parameters:

  • id (String)
  • params (Hash)

Options Hash (params):

  • :text (required, String)

    The text to read.

  • :language (String)

    The language to use. See https://developer.vonage.com/en/api/voice#startTalk-req-body for a list of valid language codes.

  • :style (Integer)

    The vocal style, as identified by an assigned integer. See https://developer.vonage.com/en/voice/voice-api/concepts/text-to-speech#supported-languages for a list of available styles.

  • :premium (Boolean)

    Set to true to use the premium version of the specified style if available, otherwise the standard version will be used.

  • :voice_name (String)

    The voice & language to use. [DEPRECATED: use language and style instead].

  • :loop (Integer)

    The number of times to repeat the text the file, 0 for infinite.

  • :level (String)

    The volume level that the speech is played. This can be any value between -1 to 1 in 0.1 increments, with 0 being the default.

Returns:

See Also:



42
43
44
# File 'lib/vonage/voice/talk.rb', line 42

def start(id, params)
  request('/v1/calls/' + id + '/talk', params: params, type: Put)
end

#stop(id) ⇒ Response

Stop text to speech in a call.

Parameters:

  • id (String)

Returns:

See Also:



54
55
56
# File 'lib/vonage/voice/talk.rb', line 54

def stop(id)
  request('/v1/calls/' + id + '/talk', type: Delete)
end