azure_stt 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -3
- data/.gitignore +2 -2
- data/CHANGELOG.md +16 -1
- data/Gemfile +3 -2
- data/README.md +2 -2
- data/azure_stt.gemspec +5 -2
- data/docs/AzureSTT/Client.html +148 -39
- data/docs/AzureSTT/Configuration.html +4 -4
- data/docs/AzureSTT/Error.html +4 -170
- data/docs/AzureSTT/Models/Base.html +4 -4
- data/docs/AzureSTT/Models/CombinedRecognizedPhrases.html +4 -4
- data/docs/AzureSTT/Models/File.html +5 -5
- data/docs/AzureSTT/Models/RecognizedPhrase.html +4 -4
- data/docs/AzureSTT/Models/Report.html +4 -4
- data/docs/AzureSTT/Models/Result.html +4 -4
- data/docs/AzureSTT/Models/Sentence.html +4 -4
- data/docs/AzureSTT/Models/Transcription.html +5 -5
- data/docs/AzureSTT/Models/Word.html +4 -4
- data/docs/AzureSTT/Models.html +4 -4
- data/docs/AzureSTT/NetError.html +161 -11
- data/docs/AzureSTT/Parsers/Base.html +4 -4
- data/docs/AzureSTT/Parsers/CombinedRecognizedPhrases.html +4 -4
- data/docs/AzureSTT/Parsers/File.html +4 -4
- data/docs/AzureSTT/Parsers/RecognizedPhrase.html +4 -4
- data/docs/AzureSTT/Parsers/Report.html +4 -4
- data/docs/AzureSTT/Parsers/Result.html +4 -4
- data/docs/AzureSTT/Parsers/Sentence.html +4 -4
- data/docs/AzureSTT/Parsers/Transcription.html +4 -4
- data/docs/AzureSTT/Parsers/Word.html +4 -4
- data/docs/AzureSTT/Parsers.html +4 -4
- data/docs/AzureSTT/ServiceError.html +161 -11
- data/docs/AzureSTT/Session.html +132 -24
- data/docs/AzureSTT/Types.html +4 -4
- data/docs/AzureSTT.html +4 -4
- data/docs/AzureStt_.html +5 -5
- data/docs/_index.html +5 -5
- data/docs/file.README.html +133 -95
- data/docs/frames.html +1 -1
- data/docs/index.html +133 -95
- data/docs/method_list.html +66 -34
- data/docs/top-level-namespace.html +4 -4
- data/lib/azure_stt/client.rb +9 -8
- data/lib/azure_stt/errors.rb +16 -9
- data/lib/azure_stt/models/file.rb +1 -1
- data/lib/azure_stt/models/transcription.rb +1 -1
- data/lib/azure_stt/parsers/combined_recognized_phrases.rb +1 -1
- data/lib/azure_stt/session.rb +8 -10
- data/lib/azure_stt/version.rb +1 -1
- data/lib/azure_stt.rb +2 -2
- metadata +7 -11
- data/.github/dependabot.yml +0 -6
- data/Gemfile.lock +0 -141
- data/docs/AzureBatchTranscription/Configuration.html +0 -212
- data/docs/AzureBatchTranscription.html +0 -301
- data/docs/AzureSTT/Transcription.html +0 -635
data/docs/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.34
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -57,143 +57,181 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'
|
61
|
-
<
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-azure_stt">azure_stt</h1>
|
62
62
|
|
63
|
-
<
|
63
|
+
<p><a href="https://badge.fury.io/rb/azure_stt"><img src="https://badge.fury.io/rb/azure_stt.svg"></a> <a href="https://github.com/PerfectMemory/azure_stt/actions/workflows/ci.yml"><img src="https://github.com/PerfectMemory/azure_stt/actions/workflows/ci.yml/badge.svg"></a> <a href="https://coveralls.io/github/PerfectMemory/azure_stt"><img src="https://coveralls.io/repos/github/PerfectMemory/azure_stt/badge.svg"></a> <a href="https://codeclimate.com/github/PerfectMemory/azure_stt/maintainability"><img src="https://api.codeclimate.com/v1/badges/375190d3122da56a9fe1/maintainability"></a></p>
|
64
64
|
|
65
|
-
<p>
|
65
|
+
<p>API Wrapper for the <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/rest-speech-to-text">Microsoft Azure Speech Services Speech-to-text REST API 3.1</a> (Cognitive Services).</p>
|
66
66
|
|
67
|
-
<
|
68
|
-
|
69
|
-
|
67
|
+
<h2 id="label-Installation">Installation</h2>
|
68
|
+
|
69
|
+
<p>Add this line to your application's Gemfile:</p>
|
70
|
+
|
71
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>azure_stt</span><span class='tstring_end'>'</span></span>
|
72
|
+
</code></pre>
|
70
73
|
|
71
74
|
<p>And then execute:</p>
|
72
75
|
|
73
|
-
<
|
74
|
-
|
75
|
-
</code></p>
|
76
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_bundle'>bundle</span>
|
77
|
+
</code></pre>
|
76
78
|
|
77
79
|
<p>Or install it yourself as:</p>
|
78
80
|
|
79
|
-
<
|
80
|
-
|
81
|
-
</code></p>
|
82
|
-
|
83
|
-
<h2 id="azure-speech-to-text-subscription-key">Azure Speech-to-text Subscription key</h2>
|
81
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_azure_stt'>azure_stt</span>
|
82
|
+
</code></pre>
|
84
83
|
|
85
|
-
<
|
86
|
-
You can generate one on your Azure account.</p>
|
84
|
+
<h2 id="label-Azure+Speech-to-text+Subscription+key">Azure Speech-to-text Subscription key</h2>
|
87
85
|
|
88
|
-
<
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
</
|
86
|
+
<p>To be able to use the gem, you must have a subscription key. You can generate one on your Azure account.</p>
|
87
|
+
<ul><li>
|
88
|
+
<p>If you don't have an Azure account, you can create one for free on <a href="https://azure.microsoft.com/en-us/free/">this page</a>.</p>
|
89
|
+
</li><li>
|
90
|
+
<p>Once logged on your <a href="https://portal.azure.com/">Azure portal</a>, subscribe to Speech in Microsoft Cognitive Services.</p>
|
91
|
+
</li><li>
|
92
|
+
<p>You will find two subscription keys available in 'RESOURCE MANAGEMENT > Keys' ('KEY 1' and 'KEY 2').</p>
|
93
|
+
</li></ul>
|
93
94
|
|
94
|
-
<h2 id="
|
95
|
+
<h2 id="label-Usage">Usage</h2>
|
95
96
|
|
96
|
-
<h3 id="
|
97
|
+
<h3 id="label-Configuration">Configuration</h3>
|
97
98
|
|
98
99
|
<p>Two environment variables are used:</p>
|
100
|
+
<ul><li>
|
101
|
+
<p>'REGION': the region of your subscription</p>
|
102
|
+
</li><li>
|
103
|
+
<p>'SUBSCRIPTION_KEY': the API key you can generate on your Azure account.</p>
|
104
|
+
</li></ul>
|
99
105
|
|
100
|
-
<
|
101
|
-
|
102
|
-
|
103
|
-
</
|
104
|
-
<
|
105
|
-
|
106
|
-
|
107
|
-
</ul>
|
108
|
-
|
109
|
-
<p>You can look at the file <code>env.sample</code> and change the values.
|
110
|
-
If you do not want to use environment variables, you can configure the values like so:</p>
|
111
|
-
|
112
|
-
<p><code>ruby
|
113
|
-
AzureSTT.configure do |config|
|
114
|
-
config.region = 'your_region'
|
115
|
-
config.subscription_key = 'your_key'
|
116
|
-
end
|
117
|
-
</code></p>
|
106
|
+
<p>You can look at the file <code>env.sample</code> and change the values. If you do not want to use environment variables, you can configure the values like so:</p>
|
107
|
+
|
108
|
+
<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="AzureSTT.html" title="AzureSTT (module)">AzureSTT</a></span></span><span class='period'>.</span><span class='id identifier rubyid_configure'><span class='object_link'><a href="AzureSTT.html#configure-class_method" title="AzureSTT.configure (method)">configure</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
|
109
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_region'>region</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>your_region</span><span class='tstring_end'>'</span></span>
|
110
|
+
<span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_subscription_key'>subscription_key</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>your_key</span><span class='tstring_end'>'</span></span>
|
111
|
+
<span class='kw'>end</span>
|
112
|
+
</code></pre>
|
118
113
|
|
119
114
|
<p>Finally, the class <code>AzureSTT::Session</code> uses by the default the values from the configuration, but you can initialize the session with custom values:</p>
|
120
115
|
|
121
|
-
<
|
122
|
-
|
123
|
-
</code></p>
|
116
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="AzureSTT.html" title="AzureSTT (module)">AzureSTT</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AzureSTT/Session.html" title="AzureSTT::Session (class)">Session</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AzureSTT/Session.html#initialize-instance_method" title="AzureSTT::Session#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>region:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>your_region</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>subscription_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>your_key</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
117
|
+
</code></pre>
|
124
118
|
|
125
|
-
<h3 id="
|
119
|
+
<h3 id="label-Start+a+transcription">Start a transcription</h3>
|
126
120
|
|
127
|
-
<
|
128
|
-
require ‘azure_stt’</p>
|
121
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>azure_stt</span><span class='tstring_end'>'</span></span>
|
129
122
|
|
130
|
-
<
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
}</
|
123
|
+
<span class='id identifier rubyid_properties'>properties</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
124
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>diarizationEnabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>false</span><span class='comma'>,</span>
|
125
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>wordLevelTimestampsEnabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>false</span><span class='comma'>,</span>
|
126
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>punctuationMode</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DictatedAndAutomatic</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
127
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>profanityFilterMode</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Masked</span><span class='tstring_end'>"</span></span>
|
128
|
+
<span class='rbrace'>}</span>
|
136
129
|
|
137
|
-
<
|
130
|
+
<span class='id identifier rubyid_content_urls'>content_urls</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>https://path.com/audio.ogg</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>https://path.com/audio1.ogg</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
138
131
|
|
139
|
-
<
|
132
|
+
<span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="AzureSTT.html" title="AzureSTT (module)">AzureSTT</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AzureSTT/Session.html" title="AzureSTT::Session (class)">Session</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AzureSTT/Session.html#initialize-instance_method" title="AzureSTT::Session#initialize (method)">new</a></span></span>
|
140
133
|
|
141
|
-
<
|
142
|
-
content_urls
|
143
|
-
properties
|
144
|
-
locale
|
145
|
-
display_name
|
134
|
+
<span class='id identifier rubyid_transcription'>transcription</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_create_transcription'>create_transcription</span><span class='lparen'>(</span>
|
135
|
+
<span class='label'>content_urls:</span> <span class='id identifier rubyid_content_urls'>content_urls</span><span class='comma'>,</span>
|
136
|
+
<span class='label'>properties:</span> <span class='id identifier rubyid_properties'>properties</span><span class='comma'>,</span>
|
137
|
+
<span class='label'>locale:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>en-US</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
138
|
+
<span class='label'>display_name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>The name of the transcription</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
146
139
|
|
147
|
-
<
|
148
|
-
|
149
|
-
|
140
|
+
<span class='comment'># You can the retrieve the results of your transcription with the id
|
141
|
+
</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_transcription'>transcription</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
|
142
|
+
<span class='comment'># Outputs 'your_transcription_id'
|
143
|
+
</span></code></pre>
|
150
144
|
|
151
|
-
<
|
145
|
+
<h3 id="label-Get+a+transcription">Get a transcription</h3>
|
152
146
|
|
153
|
-
<
|
147
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>azure_stt</span><span class='tstring_end'>'</span></span>
|
154
148
|
|
155
|
-
<
|
156
|
-
require ‘azure_stt’</p>
|
149
|
+
<span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="AzureSTT.html" title="AzureSTT (module)">AzureSTT</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AzureSTT/Session.html" title="AzureSTT::Session (class)">Session</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AzureSTT/Session.html#initialize-instance_method" title="AzureSTT::Session#initialize (method)">new</a></span></span>
|
157
150
|
|
158
|
-
<
|
151
|
+
<span class='id identifier rubyid_transcription'>transcription</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_get_transcription'>get_transcription</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>your_transcription_id</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
159
152
|
|
160
|
-
<
|
153
|
+
<span class='comment'># Returns
|
154
|
+
</span><span class='comment'># #<AzureSTT::Transcription id="d35a802d-70ae-4358-a35d-b5faa0c75457"
|
155
|
+
</span><span class='comment'># # model="" properties={"diarizationEnabled"=>false,
|
156
|
+
</span><span class='comment'># # "wordLevelTimestampsEnabled"=>false, "channels"=>[0, 1],
|
157
|
+
</span><span class='comment'># # "punctuationMode"=>"DictatedAndAutomatic", "profanityFilterMode"=>"Masked",
|
158
|
+
</span><span class='comment'># # "duration"=>"PT5M18S"}
|
159
|
+
</span><span class='comment'># # links={"files"=>"https://uscentral.api.cognitive.microsoft.com/speechtotext/v3.1/transcriptions/d35a802d-70ae-4358-a35d-b5faa0c75457/files"}
|
160
|
+
</span><span class='comment'># # last_action_date_time=#<Date: 2020-05-31 ((2459366j,0s,0n),+0s,2299161j)> created_date_time=#<Date: 2020-05-31 ((2459366j,0s,0n),+0s,2299161j)>
|
161
|
+
</span><span class='comment'># # status="Succeeded" locale="en-US" display_name="Transcription name" files=[]>
|
162
|
+
</span>
|
163
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_transcription'>transcription</span><span class='period'>.</span><span class='id identifier rubyid_succeeded?'>succeeded?</span>
|
164
|
+
<span class='comment'># You can then access to the text, for instance :
|
165
|
+
</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_transcription'>transcription</span><span class='period'>.</span><span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
166
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span>
|
167
|
+
<span class='kw'>end</span>
|
168
|
+
</code></pre>
|
161
169
|
|
162
|
-
<
|
163
|
-
<p># #<AzureSTT::Transcription id=”d35a802d-70ae-4358-a35d-b5faa0c75457”
|
164
|
-
# # model=”” properties=# # “wordLevelTimestampsEnabled”=>false, “channels”=>[0, 1],
|
165
|
-
# # “punctuationMode”=>”DictatedAndAutomatic”, “profanityFilterMode”=>”Masked”,
|
166
|
-
# # “duration”=>”PT5M18S”
|
167
|
-
# # links=<a href="“files”=>”https://uscentral.api.cognitive.microsoft.com/speechtotext/v3.0/transcriptions/d35a802d-70ae-4358-a35d-b5faa0c75457/files”" target="_parent" title="“files”=>”https://uscentral.api.cognitive.microsoft.com/speechtotext/v3.0/transcriptions/d35a802d-70ae-4358-a35d-b5faa0c75457/files”">“files”=>”https://uscentral.api.cognitive.microsoft.com/speechtotext/v3.0/transcriptions/d35a802d-70ae-4358-a35d-b5faa0c75457/files”</a>
|
168
|
-
# # last_action_date_time=#<Date: 2020-05-31 ((2459366j,0s,0n),+0s,2299161j)> created_date_time=#<Date: 2020-05-31 ((2459366j,0s,0n),+0s,2299161j)>
|
169
|
-
# # status=”Succeeded” locale=”en-US” display_name=”Transcription name” files=[]></p>
|
170
|
+
<h3 id="label-Delete+a+transcription">Delete a transcription</h3>
|
170
171
|
|
171
|
-
<
|
172
|
-
# You can then access to the text, for instance :
|
173
|
-
result = transcription.results.first
|
174
|
-
puts result.text
|
175
|
-
end
|
176
|
-
```</p>
|
172
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>azure_stt</span><span class='tstring_end'>'</span></span>
|
177
173
|
|
178
|
-
<
|
174
|
+
<span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="AzureSTT.html" title="AzureSTT (module)">AzureSTT</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AzureSTT/Session.html" title="AzureSTT::Session (class)">Session</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AzureSTT/Session.html#initialize-instance_method" title="AzureSTT::Session#initialize (method)">new</a></span></span>
|
179
175
|
|
180
|
-
<
|
176
|
+
<span class='id identifier rubyid_transcription'>transcription</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_delete_transcription'>delete_transcription</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>your_transcription_id</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
177
|
+
</code></pre>
|
178
|
+
|
179
|
+
<p>The API doesn't seem to send 404 errors when the id is unknown, but always send a 204 response. So the <code>Session#delete_transcription</code> returns <code>true</code> even when the transcription didn't exist.</p>
|
180
|
+
|
181
|
+
<h3 id="label-Starting+a+transcription-2C+fetching+the+results+and+deleting+the+transcription">Starting a transcription, fetching the results and deleting the transcription</h3>
|
182
|
+
|
183
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>azure_stt</span><span class='tstring_end'>'</span></span>
|
184
|
+
|
185
|
+
<span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="AzureSTT.html" title="AzureSTT (module)">AzureSTT</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AzureSTT/Session.html" title="AzureSTT::Session (class)">Session</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AzureSTT/Session.html#initialize-instance_method" title="AzureSTT::Session#initialize (method)">new</a></span></span>
|
186
|
+
|
187
|
+
<span class='id identifier rubyid_properties'>properties</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
188
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>diarizationEnabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>false</span><span class='comma'>,</span>
|
189
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>wordLevelTimestampsEnabled</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>false</span><span class='comma'>,</span>
|
190
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>punctuationMode</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DictatedAndAutomatic</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
191
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>profanityFilterMode</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Masked</span><span class='tstring_end'>"</span></span>
|
192
|
+
<span class='rbrace'>}</span>
|
181
193
|
|
182
|
-
<
|
194
|
+
<span class='id identifier rubyid_content_urls'>content_urls</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>https://path.com/audio.ogg</span><span class='tstring_end'>'</span></span> <span class='rbracket'>]</span>
|
195
|
+
|
196
|
+
<span class='id identifier rubyid_session'>session</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="AzureSTT.html" title="AzureSTT (module)">AzureSTT</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AzureSTT/Session.html" title="AzureSTT::Session (class)">Session</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AzureSTT/Session.html#initialize-instance_method" title="AzureSTT::Session#initialize (method)">new</a></span></span>
|
197
|
+
|
198
|
+
<span class='id identifier rubyid_transcription'>transcription</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_create_transcription'>create_transcription</span><span class='lparen'>(</span>
|
199
|
+
<span class='label'>content_urls:</span> <span class='id identifier rubyid_content_urls'>content_urls</span><span class='comma'>,</span>
|
200
|
+
<span class='label'>properties:</span> <span class='id identifier rubyid_properties'>properties</span><span class='comma'>,</span>
|
201
|
+
<span class='label'>locale:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>en-US</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
202
|
+
<span class='label'>display_name:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>The name of the transcription</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
203
|
+
|
204
|
+
<span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_transcription'>transcription</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
|
205
|
+
|
206
|
+
<span class='kw'>while</span><span class='lparen'>(</span><span class='op'>!</span><span class='id identifier rubyid_transcription'>transcription</span><span class='period'>.</span><span class='id identifier rubyid_finished?'>finished?</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
207
|
+
<span class='id identifier rubyid_sleep'>sleep</span><span class='lparen'>(</span><span class='int'>30</span><span class='rparen'>)</span>
|
208
|
+
<span class='id identifier rubyid_transcription'>transcription</span> <span class='op'>=</span> <span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_get_transcription'>get_transcription</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
209
|
+
<span class='kw'>end</span>
|
210
|
+
|
211
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_transcription'>transcription</span><span class='period'>.</span><span class='id identifier rubyid_succeeded?'>succeeded?</span><span class='rparen'>)</span>
|
212
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_transcription'>transcription</span><span class='period'>.</span><span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span>
|
213
|
+
<span class='kw'>end</span>
|
214
|
+
|
215
|
+
<span class='id identifier rubyid_session'>session</span><span class='period'>.</span><span class='id identifier rubyid_delete_transcription'>delete_transcription</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
216
|
+
</code></pre>
|
217
|
+
|
218
|
+
<h2 id="label-Development">Development</h2>
|
219
|
+
|
220
|
+
<p>After checking out the repo, run <code>bin/setup</code> to install dependencies. You can also run <code>bin/console</code> for an interactive prompt that will allow you to experiment.</p>
|
183
221
|
|
184
|
-
<h2 id="
|
222
|
+
<h2 id="label-Contributing">Contributing</h2>
|
185
223
|
|
186
|
-
<p>Bug reports and pull requests are welcome on GitHub at https://github.com/
|
224
|
+
<p>Bug reports and pull requests are welcome on GitHub at <a href="https://github.com/PerfectMemory/azure_stt">github.com/PerfectMemory/azure_stt</a>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the <a href="http://contributor-covenant.org">Contributor Covenant</a> code of conduct.</p>
|
187
225
|
|
188
|
-
<h2 id="
|
226
|
+
<h2 id="label-Code+of+Conduct">Code of Conduct</h2>
|
189
227
|
|
190
|
-
<p>Everyone interacting in the AzureStt project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the <a href="https://github.com/
|
228
|
+
<p>Everyone interacting in the AzureStt project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the <a href="https://github.com/PerfectMemory/azure_stt/blob/master/CODE_OF_CONDUCT.md">code of conduct</a>.</p>
|
191
229
|
</div></div>
|
192
230
|
|
193
231
|
<div id="footer">
|
194
|
-
Generated on
|
195
|
-
<a href="
|
196
|
-
0.9.
|
232
|
+
Generated on Wed May 10 12:30:20 2023 by
|
233
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
234
|
+
0.9.34 (ruby-2.7.7).
|
197
235
|
</div>
|
198
236
|
|
199
237
|
</div>
|