Class: Nexmo::Calls::Stream

Inherits:
Namespace
  • Object
show all
Defined in:
lib/nexmo/calls/stream.rb

Instance Method Summary collapse

Instance Method Details

#start(id, params) ⇒ Response

Play an audio file into a call.

Parameters:

  • id (String)
  • params (Hash)

Options Hash (params):

  • :stream_url (required, Array<String>)

    URL of the audio file.

  • :loop (Integer)

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

  • :level (String)

    Set the audio level of the stream in the range -1 >= level <= 1 with a precision of 0.1. The default value is 0.

Returns:

See Also:


27
28
29
# File 'lib/nexmo/calls/stream.rb', line 27

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

#stop(id) ⇒ Response

Stop playing an audio file into a call.

Parameters:

  • id (String)

Returns:

See Also:


39
40
41
# File 'lib/nexmo/calls/stream.rb', line 39

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