Class: Nexmo::Voice::Talk

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

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



32
33
34
# File 'lib/nexmo/voice/talk.rb', line 32

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:



44
45
46
# File 'lib/nexmo/voice/talk.rb', line 44

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