google_speech 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d75282abd8051652fe4ca75b4a8548eef3a9e94a
4
- data.tar.gz: 8055728db0dcab07abaec90fdcb27e09f4f34cb9
3
+ metadata.gz: ec2a81e64decb108511c6e41e180634d3c5e2fb0
4
+ data.tar.gz: 547610e9ebb2c7c8f881a952eb089ec4f2ccd0fd
5
5
  SHA512:
6
- metadata.gz: 44d39ebd415c9648dd61b9a6c6212f2b6cc92027fece77038fdc1b0907b634e212ecbb46d07a74fcd5952e47e6c5c18e464bb5d191410d9cefe922538a779fba
7
- data.tar.gz: 69ccedc953378a08a3cad93be6474ad7075633b70073ebcfed3cb4e0385f78a4e62419074a2f85b857a9912643ae89c354e4fce1728f647595acaa978d6345b0
6
+ metadata.gz: 33efc21a61cf1bce77e10ca55c5df5c545da5638e56e12cb1598388360e3d539c9f75e720ad4349bf8d0323fe410d2019042b25081715e54fe242a9044e8567f
7
+ data.tar.gz: 7658ba2000a389388bcc58d35ad120a375f6365634f0b9ffe16e5b399cb5cd94af83250091a40fd5ce3d588b364fc14e223ef3aae81bc86946002d532a371178
@@ -13,7 +13,7 @@ module GoogleSpeech
13
13
  # :client => SecureRandom.hex,
14
14
  :key => 'AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw',
15
15
  :client => 'chrome',
16
- :audio_type => 'audio/l16',
16
+ :audio_type => 'audio/x-flac',
17
17
  :rate => 8000,
18
18
  :language => 'en-us',
19
19
  :chunk_duration => 4.0,
@@ -21,7 +21,7 @@ module GoogleSpeech
21
21
  :max_results => 1,
22
22
  :request_pause => 0.1,
23
23
  :profanity_filter => true,
24
- :retry_max => 3
24
+ :retry_max => 2
25
25
  }
26
26
 
27
27
  def initialize(original_file, options=nil)
@@ -22,7 +22,8 @@ module GoogleSpeech
22
22
  def trim_and_encode(wav_path, flac_path, start, length, rate)
23
23
  check_local_file(wav_path)
24
24
 
25
- command = "sox -t wav '#{wav_path}' -t wav '#{flac_path}' norm channels 1 rate #{rate} trim #{start} #{length} compand .5,2 -80,-80,-75,-50,-30,-15,0,0"
25
+ command = "sox -t wav '#{wav_path}' -r 8000 -c 1 -t flac '#{flac_path}' trim #{start} #{length} compand .5,2 -80,-80,-75,-50,-30,-15,0,0 norm -0.1"
26
+ # command = "sox -t wav '#{wav_path}' -t wav '#{flac_path}' norm channels 1 rate #{rate} trim #{start} #{length} compand .5,2 -80,-80,-75,-50,-30,-15,0,0"
26
27
  out, err = run_command(command)
27
28
  response = out + err
28
29
  response.split("\n").each{ |l| raise("trim_and_encode: error cmd: '#{command}'\nout: '#{response}'") if l =~ SOX_ERROR_RE }
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module GoogleSpeech
4
- VERSION = "0.3.2"
4
+ VERSION = "0.3.3"
5
5
  end
@@ -5,7 +5,7 @@ require 'spec_helper'
5
5
  describe GoogleSpeech::Transcriber do
6
6
 
7
7
  it 'transcribes a file' do
8
- f = File.open(File.join(File.dirname(__FILE__), '../curiouscity.wav'))
8
+ f = File.open(File.join(File.dirname(__FILE__), 'test.wav'))
9
9
 
10
10
  transcriber = GoogleSpeech::Transcriber.new(f)
11
11
  t = transcriber.transcribe
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kuklewicz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-16 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon