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.
@@ -27,6 +27,10 @@ module GoogleSpeech
27
27
  def data
28
28
  @data ||= @chunk_file.read
29
29
  end
30
- end
31
30
 
31
+ def logger
32
+ GoogleSpeech::Utility.logger
33
+ end
34
+
35
+ end
32
36
  end
@@ -22,6 +22,10 @@ module GoogleSpeech
22
22
  pos = pos + [chunk.duration, @chunk_duration].min
23
23
  end
24
24
  end
25
- end
26
25
 
26
+ def logger
27
+ GoogleSpeech::Utility.logger
28
+ end
29
+
30
+ end
27
31
  end
@@ -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
- # puts "\n#{result[:start_time]}: #{(result[:confidence].to_f * 100).to_i}%: #{result[:text]}"
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
- end
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 = /error:/
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
- # logger.debug "run_command: #{cmd}"
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|
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module GoogleSpeech
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
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.3
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-03 00:00:00.000000000 Z
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: -4222726659936394268
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: -4222726659936394268
109
+ hash: 1407648211186855661
110
110
  requirements: []
111
111
  rubyforge_project:
112
112
  rubygems_version: 1.8.23