Class: Vonage::Voice::Stream

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



28
29
30
# File 'lib/vonage/voice/stream.rb', line 28

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:



40
41
42
# File 'lib/vonage/voice/stream.rb', line 40

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