cloudmersive-voice-recognition-api-client 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 311b63f1d0d08d384689eb523f326bf21eaa444f864e2864f4785905499393aa
4
+ data.tar.gz: 073c876d2361908ab79b4b17338eedf27753f7d0d728592538c37102047e0679
5
+ SHA512:
6
+ metadata.gz: b8d2800cbb8995257650bda27275e3ae4f6f5da9132e7467aa5dbeaeeaa8f74cac0aaa7ae111f3234566d556f08f904d40c1d40b82872464b920722720d1487b
7
+ data.tar.gz: af6ac0542a139265805c6d78c84c892fa409e74bf03032e59a2fe457d43f1849f5b32833d761c922615f7d0f3eb6a395a3e44c8dca8f68a9eb5ef3aa576014e7
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.0.0'
7
+ end
@@ -0,0 +1,103 @@
1
+ # cloudmersive-voice-recognition-api-client
2
+
3
+ CloudmersiveVoiceRecognitionApiClient - the Ruby gem for the speechapi
4
+
5
+ Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech.
6
+
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
+
9
+ - API version: v1
10
+ - Package version: 1.2.9
11
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
+
13
+ ## Installation
14
+
15
+ ### Build a gem
16
+
17
+ To build the Ruby code into a gem:
18
+
19
+ ```shell
20
+ gem build cloudmersive-voice-recognition-api-client.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./cloudmersive-voice-recognition-api-client-1.2.9.gem
27
+ ```
28
+ (for development, run `gem install --dev ./cloudmersive-voice-recognition-api-client-1.2.9.gem` to install the development dependencies)
29
+
30
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
+
32
+ Finally add this to the Gemfile:
33
+
34
+ gem 'cloudmersive-voice-recognition-api-client', '~> 1.2.9'
35
+
36
+ ### Install from Git
37
+
38
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
39
+
40
+ gem 'cloudmersive-voice-recognition-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
41
+
42
+ ### Include the Ruby code directly
43
+
44
+ Include the Ruby code directly using `-I` as follows:
45
+
46
+ ```shell
47
+ ruby -Ilib script.rb
48
+ ```
49
+
50
+ ## Getting Started
51
+
52
+ Please follow the [installation](#installation) procedure and then run the following code:
53
+ ```ruby
54
+ # Load the gem
55
+ require 'cloudmersive-voice-recognition-api-client'
56
+
57
+ # Setup authorization
58
+ CloudmersiveVoiceRecognitionApiClient.configure do |config|
59
+ # Configure API key authorization: Apikey
60
+ config.api_key['Apikey'] = 'YOUR API KEY'
61
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
62
+ #config.api_key_prefix['Apikey'] = 'Bearer'
63
+ end
64
+
65
+ api_instance = CloudmersiveVoiceRecognitionApiClient::RecognizeApi.new
66
+
67
+ speech_file = File.new("/path/to/file.txt") # File | Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported.
68
+
69
+
70
+ begin
71
+ #Recognize audio input as text using machine learning
72
+ result = api_instance.recognize_file(speech_file)
73
+ p result
74
+ rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
75
+ puts "Exception when calling RecognizeApi->recognize_file: #{e}"
76
+ end
77
+
78
+ ```
79
+
80
+ ## Documentation for API Endpoints
81
+
82
+ All URIs are relative to *https://api.cloudmersive.com*
83
+
84
+ Class | Method | HTTP request | Description
85
+ ------------ | ------------- | ------------- | -------------
86
+ *CloudmersiveVoiceRecognitionApiClient::RecognizeApi* | [**recognize_file**](docs/RecognizeApi.md#recognize_file) | **POST** /speech/recognize/file | Recognize audio input as text using machine learning
87
+ *CloudmersiveVoiceRecognitionApiClient::SpeakApi* | [**speak_post**](docs/SpeakApi.md#speak_post) | **POST** /speech/speak/text/basicVoice/{format} | Perform text-to-speech on a string
88
+
89
+
90
+ ## Documentation for Models
91
+
92
+ - [CloudmersiveVoiceRecognitionApiClient::SpeechRecognitionResult](docs/SpeechRecognitionResult.md)
93
+
94
+
95
+ ## Documentation for Authorization
96
+
97
+
98
+ ### Apikey
99
+
100
+ - **Type**: API key
101
+ - **API key parameter name**: Apikey
102
+ - **Location**: HTTP header
103
+
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
@@ -0,0 +1,45 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ =begin
4
+ #speechapi
5
+
6
+ #Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech.
7
+
8
+ OpenAPI spec version: v1
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ Swagger Codegen version: unset
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "cloudmersive-voice-recognition-api-client/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "cloudmersive-voice-recognition-api-client"
20
+ s.version = CloudmersiveVoiceRecognitionApiClient::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["Cloudmersive"]
23
+ s.email = [""]
24
+ s.homepage = "https://www.cloudmersive.com/voice-recognition-and-speech-api"
25
+ s.summary = "The most powerful and cost-effective speech recognition and voice AI APIs, continuously updated."
26
+ s.description = "Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech."
27
+ s.license = "Apache 2.0"
28
+ s.required_ruby_version = ">= 1.9"
29
+
30
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
+
33
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
+ s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
35
+ s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
36
+ s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
37
+ s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
38
+ s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
39
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
40
+
41
+ s.files = Dir['./**/*']
42
+ s.test_files = `find spec/*`.split("\n")
43
+ s.executables = []
44
+ s.require_paths = ["lib"]
45
+ end
@@ -0,0 +1,63 @@
1
+ # CloudmersiveVoiceRecognitionApiClient::RecognizeApi
2
+
3
+ All URIs are relative to *https://api.cloudmersive.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**recognize_file**](RecognizeApi.md#recognize_file) | **POST** /speech/recognize/file | Recognize audio input as text using machine learning
8
+
9
+
10
+ # **recognize_file**
11
+ > SpeechRecognitionResult recognize_file(speech_file)
12
+
13
+ Recognize audio input as text using machine learning
14
+
15
+ Uses advanced machine learning to convert input audio, which can be mp3 or wav, into text.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'cloudmersive-voice-recognition-api-client'
21
+ # setup authorization
22
+ CloudmersiveVoiceRecognitionApiClient.configure do |config|
23
+ # Configure API key authorization: Apikey
24
+ config.api_key['Apikey'] = 'YOUR API KEY'
25
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
26
+ #config.api_key_prefix['Apikey'] = 'Bearer'
27
+ end
28
+
29
+ api_instance = CloudmersiveVoiceRecognitionApiClient::RecognizeApi.new
30
+
31
+ speech_file = File.new("/path/to/file.txt") # File | Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported.
32
+
33
+
34
+ begin
35
+ #Recognize audio input as text using machine learning
36
+ result = api_instance.recognize_file(speech_file)
37
+ p result
38
+ rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
39
+ puts "Exception when calling RecognizeApi->recognize_file: #{e}"
40
+ end
41
+ ```
42
+
43
+ ### Parameters
44
+
45
+ Name | Type | Description | Notes
46
+ ------------- | ------------- | ------------- | -------------
47
+ **speech_file** | **File**| Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported. |
48
+
49
+ ### Return type
50
+
51
+ [**SpeechRecognitionResult**](SpeechRecognitionResult.md)
52
+
53
+ ### Authorization
54
+
55
+ [Apikey](../README.md#Apikey)
56
+
57
+ ### HTTP request headers
58
+
59
+ - **Content-Type**: multipart/form-data
60
+ - **Accept**: application/json, text/json, application/xml, text/xml
61
+
62
+
63
+
@@ -0,0 +1,66 @@
1
+ # CloudmersiveVoiceRecognitionApiClient::SpeakApi
2
+
3
+ All URIs are relative to *https://api.cloudmersive.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**speak_post**](SpeakApi.md#speak_post) | **POST** /speech/speak/text/basicVoice/{format} | Perform text-to-speech on a string
8
+
9
+
10
+ # **speak_post**
11
+ > Object speak_post(format, text)
12
+
13
+ Perform text-to-speech on a string
14
+
15
+ Takes as input a string and a file format (mp3 or wav) and outputs a wave form in the appropriate format.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'cloudmersive-voice-recognition-api-client'
21
+ # setup authorization
22
+ CloudmersiveVoiceRecognitionApiClient.configure do |config|
23
+ # Configure API key authorization: Apikey
24
+ config.api_key['Apikey'] = 'YOUR API KEY'
25
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
26
+ #config.api_key_prefix['Apikey'] = 'Bearer'
27
+ end
28
+
29
+ api_instance = CloudmersiveVoiceRecognitionApiClient::SpeakApi.new
30
+
31
+ format = "format_example" # String | File format to generate response in; possible values are \"mp3\" or \"wav\"
32
+
33
+ text = "text_example" # String | The text you would like to conver to speech. Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\"
34
+
35
+
36
+ begin
37
+ #Perform text-to-speech on a string
38
+ result = api_instance.speak_post(format, text)
39
+ p result
40
+ rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
41
+ puts "Exception when calling SpeakApi->speak_post: #{e}"
42
+ end
43
+ ```
44
+
45
+ ### Parameters
46
+
47
+ Name | Type | Description | Notes
48
+ ------------- | ------------- | ------------- | -------------
49
+ **format** | **String**| File format to generate response in; possible values are \"mp3\" or \"wav\" |
50
+ **text** | **String**| The text you would like to conver to speech. Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\" |
51
+
52
+ ### Return type
53
+
54
+ **Object**
55
+
56
+ ### Authorization
57
+
58
+ [Apikey](../README.md#Apikey)
59
+
60
+ ### HTTP request headers
61
+
62
+ - **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
63
+ - **Accept**: application/json, text/json, application/xml, text/xml
64
+
65
+
66
+
@@ -0,0 +1,8 @@
1
+ # CloudmersiveVoiceRecognitionApiClient::SpeechRecognitionResult
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **text_result** | **String** | Recognition result in text format | [optional]
7
+
8
+
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="GIT_USER_ID"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="GIT_REPO_ID"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #speechapi
3
+
4
+ #Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'cloudmersive-voice-recognition-api-client/api_client'
15
+ require 'cloudmersive-voice-recognition-api-client/api_error'
16
+ require 'cloudmersive-voice-recognition-api-client/version'
17
+ require 'cloudmersive-voice-recognition-api-client/configuration'
18
+
19
+ # Models
20
+ require 'cloudmersive-voice-recognition-api-client/models/speech_recognition_result'
21
+
22
+ # APIs
23
+ require 'cloudmersive-voice-recognition-api-client/api/recognize_api'
24
+ require 'cloudmersive-voice-recognition-api-client/api/speak_api'
25
+
26
+ module CloudmersiveVoiceRecognitionApiClient
27
+ class << self
28
+ # Customize default settings for the SDK using block.
29
+ # CloudmersiveVoiceRecognitionApiClient.configure do |config|
30
+ # config.username = "xxx"
31
+ # config.password = "xxx"
32
+ # end
33
+ # If no block given, return the default Configuration object.
34
+ def configure
35
+ if block_given?
36
+ yield(Configuration.default)
37
+ else
38
+ Configuration.default
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,79 @@
1
+ =begin
2
+ #speechapi
3
+
4
+ #Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudmersiveVoiceRecognitionApiClient
16
+ class RecognizeApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Recognize audio input as text using machine learning
24
+ # Uses advanced machine learning to convert input audio, which can be mp3 or wav, into text.
25
+ # @param speech_file Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [SpeechRecognitionResult]
28
+ def recognize_file(speech_file, opts = {})
29
+ data, _status_code, _headers = recognize_file_with_http_info(speech_file, opts)
30
+ return data
31
+ end
32
+
33
+ # Recognize audio input as text using machine learning
34
+ # Uses advanced machine learning to convert input audio, which can be mp3 or wav, into text.
35
+ # @param speech_file Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported.
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(SpeechRecognitionResult, Fixnum, Hash)>] SpeechRecognitionResult data, response status code and response headers
38
+ def recognize_file_with_http_info(speech_file, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: RecognizeApi.recognize_file ..."
41
+ end
42
+ # verify the required parameter 'speech_file' is set
43
+ if @api_client.config.client_side_validation && speech_file.nil?
44
+ fail ArgumentError, "Missing the required parameter 'speech_file' when calling RecognizeApi.recognize_file"
45
+ end
46
+ # resource path
47
+ local_var_path = "/speech/recognize/file"
48
+
49
+ # query parameters
50
+ query_params = {}
51
+
52
+ # header parameters
53
+ header_params = {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
56
+ # HTTP header 'Content-Type'
57
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
58
+
59
+ # form parameters
60
+ form_params = {}
61
+ form_params["speechFile"] = speech_file
62
+
63
+ # http body (model)
64
+ post_body = nil
65
+ auth_names = ['Apikey']
66
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'SpeechRecognitionResult')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: RecognizeApi#recognize_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+ end
79
+ end