Class: Speechpad::Client
- Inherits:
-
Object
- Object
- Speechpad::Client
- Includes:
- Connection, Request
- Defined in:
- lib/speechpad/client.rb
Instance Method Summary collapse
-
#add_audio_url(url, visible_filename = url, transcribe = true, options = {}) ⇒ Mash
Add a new audio to the user’s account from a URL, should be a file.
-
#add_media_url(url, transcribe = true, options = {}) ⇒ Mash
Add a new media to the user’s account from a URL, like Youtube.
-
#get_machine_transcription(audio_id, options = {}) ⇒ Mash
Return the machine transcription status of one or more audio files.
-
#get_transcription(audio_id, options = {}) ⇒ Mash
Return the transcription status of one or more audio files.
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
-
#machine_transcription_status(audio_id, options = {}) ⇒ Mash
Return the machine transcription status of one or more audio files.
-
#test(options = {}) ⇒ Mash
A test call for the Speechpad API (only works on dev).
-
#transcription_status(audio_id, options = {}) ⇒ Mash
Return the transcription status of one or more audio files.
Methods included from Request
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 |
# File 'lib/speechpad/client.rb', line 6 def initialize(={}) @access_key = [:access_key] @secret_key = [:secret_key] @speechpad_url = [:url] || 'https://www.speechpad.com/' end |
Instance Method Details
#add_audio_url(url, visible_filename = url, transcribe = true, options = {}) ⇒ Mash
Add a new audio to the user’s account from a URL, should be a file.
25 26 27 28 29 |
# File 'lib/speechpad/client.rb', line 25 def add_audio_url(url, visible_filename=url, transcribe=true, ={}) params = build_params({'operation' => 'add_audio_url', 'method' => 'post', 'visible_filename' => visible_filename, 'url' => url, 'transcribe' => transcribe}.merge()) get(params) end |
#add_media_url(url, transcribe = true, options = {}) ⇒ Mash
Add a new media to the user’s account from a URL, like Youtube.
40 41 42 43 |
# File 'lib/speechpad/client.rb', line 40 def add_media_url(url, transcribe=true, ={}) params = build_params({'operation' => 'add_media_url', 'method' => 'post', 'url' => url, 'transcribe' => transcribe}.merge()) get(params) end |
#get_machine_transcription(audio_id, options = {}) ⇒ Mash
Return the machine transcription status of one or more audio files.
66 67 68 69 |
# File 'lib/speechpad/client.rb', line 66 def get_machine_transcription(audio_id, ={}) params = build_params({'operation' => 'get_machine_transcription', 'method' => 'get', 'audio_id' => audio_id}.merge()) get(params) end |
#get_transcription(audio_id, options = {}) ⇒ Mash
Return the transcription status of one or more audio files.
53 54 55 56 |
# File 'lib/speechpad/client.rb', line 53 def get_transcription(audio_id, ={}) params = build_params({'operation' => 'get_transcription', 'method' => 'get', 'audio_id' => audio_id}.merge()) get(params) end |
#machine_transcription_status(audio_id, options = {}) ⇒ Mash
Return the machine transcription status of one or more audio files.
80 81 82 83 |
# File 'lib/speechpad/client.rb', line 80 def machine_transcription_status(audio_id, ={}) params = build_params({'operation' => 'machine_transcription_status', 'method' => 'get', 'audio_id' => audio_id}.merge()) get(params) end |
#test(options = {}) ⇒ Mash
A test call for the Speechpad API (only works on dev).
105 106 107 108 |
# File 'lib/speechpad/client.rb', line 105 def test(={}) params = build_params({'operation' => 'test', 'value' => '123', 'method' => 'get'}.merge()) get(params, ) end |
#transcription_status(audio_id, options = {}) ⇒ Mash
Return the transcription status of one or more audio files.
93 94 95 96 |
# File 'lib/speechpad/client.rb', line 93 def transcription_status(audio_id, ={}) params = build_params({'operation' => 'transcription_status', 'method' => 'get', 'audio_id' => audio_id}.merge()) get(params) end |