cloudmersive-voice-recognition-api-client 2.0.1 → 2.1.0
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.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/README.md +108 -0
- data/Rakefile +8 -0
- data/cloudmersive-voice-recognition-api-client.gemspec +45 -0
- data/docs/RecognizeApi.md +68 -0
- data/docs/SpeakApi.md +64 -0
- data/docs/SpeechRecognitionResult.md +9 -0
- data/docs/TextToSpeechRequest.md +11 -0
- data/docs/TokenTimestamp.md +12 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-voice-recognition-api-client/api/recognize_api.rb +80 -0
- data/lib/cloudmersive-voice-recognition-api-client/api/speak_api.rb +73 -0
- data/lib/cloudmersive-voice-recognition-api-client/api_client.rb +391 -0
- data/lib/cloudmersive-voice-recognition-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-voice-recognition-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-voice-recognition-api-client/models/speech_recognition_result.rb +198 -0
- data/lib/cloudmersive-voice-recognition-api-client/models/text_to_speech_request.rb +216 -0
- data/lib/cloudmersive-voice-recognition-api-client/models/token_timestamp.rb +226 -0
- data/lib/cloudmersive-voice-recognition-api-client/version.rb +15 -0
- data/lib/cloudmersive-voice-recognition-api-client.rb +44 -0
- data/spec/api/recognize_api_spec.rb +49 -0
- data/spec/api/speak_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/speech_recognition_result_spec.rb +47 -0
- data/spec/models/text_to_speech_request_spec.rb +59 -0
- data/spec/models/token_timestamp_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +47 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 405d1f8b1c560ca95a63f43d192353b7ac1ab6d5a767d0e3315bd4860e0e0c64
|
|
4
|
+
data.tar.gz: 0c2e9209da9da2b8115914c7a9a07df738118c2156a1fe158f112e374d3f30f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b407d596fa94ce643b5726b50d531967a7783544134c922e32d3397ed68d6acf85020e81c69e70ff93af77c89408c37ef9dc21486609011ba4ad343d1df5819
|
|
7
|
+
data.tar.gz: 04bf4981020bd2392dad38724ef8729bd85d89a05fc10581c318e19de8e62906c95ba3d7318ea06cb28dd20ad56fb3d75f3bf808ea17f0deae6ad359aa2447bf
|
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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: 2.1.0
|
|
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-2.1.0.gem
|
|
27
|
+
```
|
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-voice-recognition-api-client-2.1.0.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', '~> 2.1.0'
|
|
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
|
+
opts = {
|
|
68
|
+
language_code: '', # String | ISO 639-3 three-letter language code (e.g. eng, spa, fra). Empty for auto-detect.
|
|
69
|
+
recognition_mode: 'Normal', # String | Recognition mode: Fast, Normal (default), or Advanced. Advanced is only available on Private Cloud and Managed Instance deployments.
|
|
70
|
+
speech_file: File.new('/path/to/file.txt') # File |
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
begin
|
|
74
|
+
#Recognize audio input as text using Advanced AI
|
|
75
|
+
result = api_instance.speech_recognize_file_post(opts)
|
|
76
|
+
p result
|
|
77
|
+
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
|
|
78
|
+
puts "Exception when calling RecognizeApi->speech_recognize_file_post: #{e}"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Documentation for API Endpoints
|
|
84
|
+
|
|
85
|
+
All URIs are relative to *https://testapi.cloudmersive.com*
|
|
86
|
+
|
|
87
|
+
Class | Method | HTTP request | Description
|
|
88
|
+
------------ | ------------- | ------------- | -------------
|
|
89
|
+
*CloudmersiveVoiceRecognitionApiClient::RecognizeApi* | [**speech_recognize_file_post**](docs/RecognizeApi.md#speech_recognize_file_post) | **POST** /speech/recognize/file | Recognize audio input as text using Advanced AI
|
|
90
|
+
*CloudmersiveVoiceRecognitionApiClient::SpeakApi* | [**speech_speak_text_voice_basic_audio_post**](docs/SpeakApi.md#speech_speak_text_voice_basic_audio_post) | **POST** /speech/speak/text/voice/basic/audio | Generate audio from text using Advanced AI
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## Documentation for Models
|
|
94
|
+
|
|
95
|
+
- [CloudmersiveVoiceRecognitionApiClient::SpeechRecognitionResult](docs/SpeechRecognitionResult.md)
|
|
96
|
+
- [CloudmersiveVoiceRecognitionApiClient::TextToSpeechRequest](docs/TextToSpeechRequest.md)
|
|
97
|
+
- [CloudmersiveVoiceRecognitionApiClient::TokenTimestamp](docs/TokenTimestamp.md)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## Documentation for Authorization
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Apikey
|
|
104
|
+
|
|
105
|
+
- **Type**: API key
|
|
106
|
+
- **API key parameter name**: Apikey
|
|
107
|
+
- **Location**: HTTP header
|
|
108
|
+
|
data/Rakefile
ADDED
|
@@ -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: 2.4.14
|
|
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,68 @@
|
|
|
1
|
+
# CloudmersiveVoiceRecognitionApiClient::RecognizeApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://testapi.cloudmersive.com*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**speech_recognize_file_post**](RecognizeApi.md#speech_recognize_file_post) | **POST** /speech/recognize/file | Recognize audio input as text using Advanced AI
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# **speech_recognize_file_post**
|
|
11
|
+
> SpeechRecognitionResult speech_recognize_file_post(opts)
|
|
12
|
+
|
|
13
|
+
Recognize audio input as text using Advanced AI
|
|
14
|
+
|
|
15
|
+
Uses advanced AI to convert input audio to text. Supports WAV, MP3, M4A, FLAC, OGG, and WMA formats. Consumes 1 API call per second of audio in Fast mode, 5 API calls per second in Normal mode, and 10 API calls per second in Advanced mode.
|
|
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
|
+
opts = {
|
|
32
|
+
language_code: '', # String | ISO 639-3 three-letter language code (e.g. eng, spa, fra). Empty for auto-detect.
|
|
33
|
+
recognition_mode: 'Normal', # String | Recognition mode: Fast, Normal (default), or Advanced. Advanced is only available on Private Cloud and Managed Instance deployments.
|
|
34
|
+
speech_file: File.new('/path/to/file.txt') # File |
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
begin
|
|
38
|
+
#Recognize audio input as text using Advanced AI
|
|
39
|
+
result = api_instance.speech_recognize_file_post(opts)
|
|
40
|
+
p result
|
|
41
|
+
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
|
|
42
|
+
puts "Exception when calling RecognizeApi->speech_recognize_file_post: #{e}"
|
|
43
|
+
end
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Parameters
|
|
47
|
+
|
|
48
|
+
Name | Type | Description | Notes
|
|
49
|
+
------------- | ------------- | ------------- | -------------
|
|
50
|
+
**language_code** | **String**| ISO 639-3 three-letter language code (e.g. eng, spa, fra). Empty for auto-detect. | [optional] [default to ]
|
|
51
|
+
**recognition_mode** | **String**| Recognition mode: Fast, Normal (default), or Advanced. Advanced is only available on Private Cloud and Managed Instance deployments. | [optional] [default to Normal]
|
|
52
|
+
**speech_file** | **File**| | [optional]
|
|
53
|
+
|
|
54
|
+
### Return type
|
|
55
|
+
|
|
56
|
+
[**SpeechRecognitionResult**](SpeechRecognitionResult.md)
|
|
57
|
+
|
|
58
|
+
### Authorization
|
|
59
|
+
|
|
60
|
+
[Apikey](../README.md#Apikey)
|
|
61
|
+
|
|
62
|
+
### HTTP request headers
|
|
63
|
+
|
|
64
|
+
- **Content-Type**: multipart/form-data
|
|
65
|
+
- **Accept**: text/plain, application/json, text/json
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
data/docs/SpeakApi.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# CloudmersiveVoiceRecognitionApiClient::SpeakApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://testapi.cloudmersive.com*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**speech_speak_text_voice_basic_audio_post**](SpeakApi.md#speech_speak_text_voice_basic_audio_post) | **POST** /speech/speak/text/voice/basic/audio | Generate audio from text using Advanced AI
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# **speech_speak_text_voice_basic_audio_post**
|
|
11
|
+
> String speech_speak_text_voice_basic_audio_post(opts)
|
|
12
|
+
|
|
13
|
+
Generate audio from text using Advanced AI
|
|
14
|
+
|
|
15
|
+
Converts text to speech using advanced AI. Supports English, Spanish, French, Hindi, Italian, Japanese, Portuguese, and Chinese. Specify language with LanguageCode (ISO 639-3, default: eng) and gender with Gender (Male or Female, default: Female). Output format is controlled by the Format field (mp3 or wav, default: mp3). Consumes 1 API call per second of generated audio.
|
|
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
|
+
opts = {
|
|
32
|
+
body: CloudmersiveVoiceRecognitionApiClient::TextToSpeechRequest.new # TextToSpeechRequest | String input request
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
begin
|
|
36
|
+
#Generate audio from text using Advanced AI
|
|
37
|
+
result = api_instance.speech_speak_text_voice_basic_audio_post(opts)
|
|
38
|
+
p result
|
|
39
|
+
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
|
|
40
|
+
puts "Exception when calling SpeakApi->speech_speak_text_voice_basic_audio_post: #{e}"
|
|
41
|
+
end
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Parameters
|
|
45
|
+
|
|
46
|
+
Name | Type | Description | Notes
|
|
47
|
+
------------- | ------------- | ------------- | -------------
|
|
48
|
+
**body** | [**TextToSpeechRequest**](TextToSpeechRequest.md)| String input request | [optional]
|
|
49
|
+
|
|
50
|
+
### Return type
|
|
51
|
+
|
|
52
|
+
**String**
|
|
53
|
+
|
|
54
|
+
### Authorization
|
|
55
|
+
|
|
56
|
+
[Apikey](../README.md#Apikey)
|
|
57
|
+
|
|
58
|
+
### HTTP request headers
|
|
59
|
+
|
|
60
|
+
- **Content-Type**: application/json, text/json, application/*+json
|
|
61
|
+
- **Accept**: application/octet-stream
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# CloudmersiveVoiceRecognitionApiClient::SpeechRecognitionResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**text_result** | **String** | Recognition result in text format | [optional]
|
|
7
|
+
**timestamps** | [**Array<TokenTimestamp>**](TokenTimestamp.md) | Token-level timestamps with character offsets into TextResult | [optional]
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# CloudmersiveVoiceRecognitionApiClient::TextToSpeechRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**text** | **String** | Text to be converted to speech | [optional]
|
|
7
|
+
**format** | **String** | File format for output audio file: wav or mp3, default is mp3 | [optional]
|
|
8
|
+
**language_code** | **String** | ISO 639-3 three-letter language code (e.g. eng, spa, fra, hin, ita, jpn, por, zho). Default is eng (English). | [optional]
|
|
9
|
+
**gender** | **String** | Voice gender: Male or Female. Default is Female. Note: Male is not available for French and Chinese. | [optional]
|
|
10
|
+
|
|
11
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# CloudmersiveVoiceRecognitionApiClient::TokenTimestamp
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**token** | **String** | The token text (word or subword) | [optional]
|
|
7
|
+
**character_offset_start** | **Integer** | Start character offset (0-based) in TextResult | [optional]
|
|
8
|
+
**character_offset_end** | **Integer** | End character offset (exclusive) in TextResult | [optional]
|
|
9
|
+
**start_time_ms** | **Integer** | Start time of this token in the audio, in milliseconds | [optional]
|
|
10
|
+
**end_time_ms** | **Integer** | End time of this token in the audio, in milliseconds | [optional]
|
|
11
|
+
|
|
12
|
+
|
data/git_push.sh
ADDED
|
@@ -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,80 @@
|
|
|
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: 2.4.14
|
|
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
|
+
# Recognize audio input as text using Advanced AI
|
|
23
|
+
# Uses advanced AI to convert input audio to text. Supports WAV, MP3, M4A, FLAC, OGG, and WMA formats. Consumes 1 API call per second of audio in Fast mode, 5 API calls per second in Normal mode, and 10 API calls per second in Advanced mode.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :language_code ISO 639-3 three-letter language code (e.g. eng, spa, fra). Empty for auto-detect. (default to )
|
|
26
|
+
# @option opts [String] :recognition_mode Recognition mode: Fast, Normal (default), or Advanced. Advanced is only available on Private Cloud and Managed Instance deployments. (default to Normal)
|
|
27
|
+
# @option opts [File] :speech_file
|
|
28
|
+
# @return [SpeechRecognitionResult]
|
|
29
|
+
def speech_recognize_file_post(opts = {})
|
|
30
|
+
data, _status_code, _headers = speech_recognize_file_post_with_http_info(opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Recognize audio input as text using Advanced AI
|
|
35
|
+
# Uses advanced AI to convert input audio to text. Supports WAV, MP3, M4A, FLAC, OGG, and WMA formats. Consumes 1 API call per second of audio in Fast mode, 5 API calls per second in Normal mode, and 10 API calls per second in Advanced mode.
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [String] :language_code ISO 639-3 three-letter language code (e.g. eng, spa, fra). Empty for auto-detect.
|
|
38
|
+
# @option opts [String] :recognition_mode Recognition mode: Fast, Normal (default), or Advanced. Advanced is only available on Private Cloud and Managed Instance deployments.
|
|
39
|
+
# @option opts [File] :speech_file
|
|
40
|
+
# @return [Array<(SpeechRecognitionResult, Fixnum, Hash)>] SpeechRecognitionResult data, response status code and response headers
|
|
41
|
+
def speech_recognize_file_post_with_http_info(opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: RecognizeApi.speech_recognize_file_post ...'
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/speech/recognize/file'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
|
57
|
+
header_params[:'languageCode'] = opts[:'language_code'] if !opts[:'language_code'].nil?
|
|
58
|
+
header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
|
|
59
|
+
|
|
60
|
+
# form parameters
|
|
61
|
+
form_params = {}
|
|
62
|
+
form_params['speechFile'] = opts[:'speech_file'] if !opts[:'speech_file'].nil?
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = nil
|
|
66
|
+
auth_names = ['Apikey']
|
|
67
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
68
|
+
:header_params => header_params,
|
|
69
|
+
:query_params => query_params,
|
|
70
|
+
:form_params => form_params,
|
|
71
|
+
:body => post_body,
|
|
72
|
+
:auth_names => auth_names,
|
|
73
|
+
:return_type => 'SpeechRecognitionResult')
|
|
74
|
+
if @api_client.config.debugging
|
|
75
|
+
@api_client.config.logger.debug "API called: RecognizeApi#speech_recognize_file_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
76
|
+
end
|
|
77
|
+
return data, status_code, headers
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
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: 2.4.14
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'uri'
|
|
14
|
+
|
|
15
|
+
module CloudmersiveVoiceRecognitionApiClient
|
|
16
|
+
class SpeakApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Generate audio from text using Advanced AI
|
|
23
|
+
# Converts text to speech using advanced AI. Supports English, Spanish, French, Hindi, Italian, Japanese, Portuguese, and Chinese. Specify language with LanguageCode (ISO 639-3, default: eng) and gender with Gender (Male or Female, default: Female). Output format is controlled by the Format field (mp3 or wav, default: mp3). Consumes 1 API call per second of generated audio.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [TextToSpeechRequest] :body String input request
|
|
26
|
+
# @return [String]
|
|
27
|
+
def speech_speak_text_voice_basic_audio_post(opts = {})
|
|
28
|
+
data, _status_code, _headers = speech_speak_text_voice_basic_audio_post_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Generate audio from text using Advanced AI
|
|
33
|
+
# Converts text to speech using advanced AI. Supports English, Spanish, French, Hindi, Italian, Japanese, Portuguese, and Chinese. Specify language with LanguageCode (ISO 639-3, default: eng) and gender with Gender (Male or Female, default: Female). Output format is controlled by the Format field (mp3 or wav, default: mp3). Consumes 1 API call per second of generated audio.
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @option opts [TextToSpeechRequest] :body String input request
|
|
36
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
37
|
+
def speech_speak_text_voice_basic_audio_post_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: SpeakApi.speech_speak_text_voice_basic_audio_post ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/speech/speak/text/voice/basic/audio'
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
|
51
|
+
# HTTP header 'Content-Type'
|
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/*+json'])
|
|
53
|
+
|
|
54
|
+
# form parameters
|
|
55
|
+
form_params = {}
|
|
56
|
+
|
|
57
|
+
# http body (model)
|
|
58
|
+
post_body = @api_client.object_to_http_body(opts[:'body'])
|
|
59
|
+
auth_names = ['Apikey']
|
|
60
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
61
|
+
:header_params => header_params,
|
|
62
|
+
:query_params => query_params,
|
|
63
|
+
:form_params => form_params,
|
|
64
|
+
:body => post_body,
|
|
65
|
+
:auth_names => auth_names,
|
|
66
|
+
:return_type => 'String')
|
|
67
|
+
if @api_client.config.debugging
|
|
68
|
+
@api_client.config.logger.debug "API called: SpeakApi#speech_speak_text_voice_basic_audio_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
69
|
+
end
|
|
70
|
+
return data, status_code, headers
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|