Class: Nexmo::Calls::Talk

Inherits:
Namespace
  • Object
show all
Defined in:
lib/nexmo/calls/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.

  • :voice_name (String)

    The voice & language to use.

  • :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:


31
32
33
# File 'lib/nexmo/calls/talk.rb', line 31

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:


43
44
45
# File 'lib/nexmo/calls/talk.rb', line 43

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