google_speech 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
data/lib/google_speech/chunk.rb
CHANGED
@@ -29,13 +29,12 @@ module GoogleSpeech
|
|
29
29
|
result = chunk.to_hash
|
30
30
|
transcript = transcribe_data(chunk.data)
|
31
31
|
next unless transcript
|
32
|
-
# puts "transcript: #{transcript.inspect}\n\n"
|
33
32
|
hypothesis = transcript['hypotheses'].first || Hash.new("")
|
34
33
|
result[:text] = hypothesis['utterance']
|
35
34
|
result[:confidence] = hypothesis['confidence']
|
36
35
|
@results << result
|
37
36
|
|
38
|
-
|
37
|
+
logger.debug "#{result[:start_time]}: #{(result[:confidence].to_f * 100).to_i}%: #{result[:text]}"
|
39
38
|
|
40
39
|
sleep(options[:request_pause].to_i)
|
41
40
|
}
|
@@ -81,6 +80,9 @@ module GoogleSpeech
|
|
81
80
|
result
|
82
81
|
end
|
83
82
|
|
84
|
-
|
83
|
+
def logger
|
84
|
+
GoogleSpeech::Utility.logger
|
85
|
+
end
|
85
86
|
|
87
|
+
end
|
86
88
|
end
|
@@ -8,7 +8,7 @@ module GoogleSpeech
|
|
8
8
|
|
9
9
|
class Utility
|
10
10
|
|
11
|
-
SOX_ERROR_RE
|
11
|
+
SOX_ERROR_RE = /error:/
|
12
12
|
|
13
13
|
class <<self
|
14
14
|
|
@@ -50,7 +50,7 @@ module GoogleSpeech
|
|
50
50
|
|
51
51
|
cmd = "#{nice}#{command}#{echo_return}"
|
52
52
|
|
53
|
-
|
53
|
+
logger.info "google_speech - run_command: #{cmd}"
|
54
54
|
begin
|
55
55
|
result = Timeout::timeout(timeout) {
|
56
56
|
Open3::popen3(cmd) do |i,o,e|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_speech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: excon
|
@@ -97,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
segments:
|
99
99
|
- 0
|
100
|
-
hash:
|
100
|
+
hash: 1407648211186855661
|
101
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
102
|
none: false
|
103
103
|
requirements:
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
segments:
|
108
108
|
- 0
|
109
|
-
hash:
|
109
|
+
hash: 1407648211186855661
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
112
|
rubygems_version: 1.8.23
|