speech_to_text 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 10ec72223c38321ebb767a5dae107c2e6ff73c950c3e34234a4424058a9076e5
4
- data.tar.gz: a06502b4c03d9cdf61e5b4df5b26cec337f0daf71d31149cdb167dd2aeeabd96
3
+ metadata.gz: c0555b2eb876fc204f1c3c74365172849767e78d26e92a11b2eb76ca5cb5627e
4
+ data.tar.gz: ccc2c7e546ffafaa8c7855a185ce69a8f552ce4fcfa8f6499fbf67720f87d74f
5
5
  SHA512:
6
- metadata.gz: b42c4efe6d40b2eeebfaa17d4e700160eee63eb3b47b64c647f97184af690e1af06754f3b86a571e1dbe9da6f09a4c350c40ff20296b69a355f4d169ebd885ed
7
- data.tar.gz: ece3d7d55f342de14df69437f2746bbc4c63402c9ffa3b35954026ed055a206f11e56af14e9f16c75d32377bf8c634c623d48e798309786b9bd98315850d8e5e
6
+ metadata.gz: e3fe3c9c3db83fb650ab3c69cf24332a99fa6595a966191ff5ae35d68287abc6bbd24c1e4ee1f32e2b173911e85d5e15bac2b75291447a5ee067e27ba6a9c8b1
7
+ data.tar.gz: 71b507378f8afac67e58cf7618cb61db1cdb27a27a5d864346398ee0e2b61fb00076aaf2b22dfab83f69b907513a608ef62ccd1dd84cef73a1938c0bc2dde625
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- speech_to_text (0.1.1)
4
+ speech_to_text (0.1.2)
5
5
  google-cloud-speech (= 0.35.0)
6
6
  google-cloud-storage (= 1.18.2)
7
7
  ibm_watson (~> 0.18.2)
@@ -9,8 +9,8 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.6.0)
13
- public_suffix (>= 2.0.2, < 4.0)
12
+ addressable (2.7.0)
13
+ public_suffix (>= 2.0.2, < 5.0)
14
14
  concurrent-ruby (1.1.5)
15
15
  declarative (0.0.10)
16
16
  declarative-option (0.1.0)
@@ -18,22 +18,22 @@ GEM
18
18
  domain_name (0.5.20190701)
19
19
  unf (>= 0.0.5, < 1.0.0)
20
20
  eventmachine (1.2.7)
21
- faraday (0.15.4)
21
+ faraday (0.17.0)
22
22
  multipart-post (>= 1.2, < 3)
23
23
  faye-websocket (0.10.9)
24
24
  eventmachine (>= 0.12.0)
25
25
  websocket-driver (>= 0.5.1)
26
- google-api-client (0.30.6)
26
+ google-api-client (0.33.1)
27
27
  addressable (~> 2.5, >= 2.5.1)
28
- googleauth (>= 0.5, < 0.10.0)
28
+ googleauth (~> 0.9)
29
29
  httpclient (>= 2.8.1, < 3.0)
30
30
  mini_mime (~> 1.0)
31
31
  representable (~> 3.0)
32
32
  retriable (>= 2.0, < 4.0)
33
- signet (~> 0.10)
34
- google-cloud-core (1.3.0)
33
+ signet (~> 0.12)
34
+ google-cloud-core (1.3.2)
35
35
  google-cloud-env (~> 1.0)
36
- google-cloud-env (1.2.0)
36
+ google-cloud-env (1.2.1)
37
37
  faraday (~> 0.11)
38
38
  google-cloud-speech (0.35.0)
39
39
  google-gax (~> 1.3)
@@ -44,31 +44,27 @@ GEM
44
44
  google-cloud-core (~> 1.2)
45
45
  googleauth (>= 0.6.2, < 0.10.0)
46
46
  mime-types (~> 3.0)
47
- google-gax (1.7.0)
48
- google-protobuf (~> 3.2)
49
- googleapis-common-protos (>= 1.3.5, < 2.0)
50
- googleauth (>= 0.6.2, < 0.10.0)
51
- grpc (>= 1.7.2, < 2.0)
47
+ google-gax (1.8.1)
48
+ google-protobuf (~> 3.9)
49
+ googleapis-common-protos (>= 1.3.9, < 2.0)
50
+ googleauth (~> 0.9)
51
+ grpc (~> 1.24)
52
52
  rly (~> 0.2.3)
53
- google-protobuf (3.8.0)
54
- google-protobuf (3.8.0-x64-mingw32)
53
+ google-protobuf (3.10.0-x86_64-linux)
55
54
  googleapis-common-protos (1.3.9)
56
55
  google-protobuf (~> 3.0)
57
56
  googleapis-common-protos-types (~> 1.0)
58
57
  grpc (~> 1.0)
59
58
  googleapis-common-protos-types (1.0.4)
60
59
  google-protobuf (~> 3.0)
61
- googleauth (0.8.1)
60
+ googleauth (0.9.0)
62
61
  faraday (~> 0.12)
63
62
  jwt (>= 1.4, < 3.0)
64
63
  memoist (~> 0.16)
65
64
  multi_json (~> 1.11)
66
65
  os (>= 0.9, < 2.0)
67
66
  signet (~> 0.7)
68
- grpc (1.21.0)
69
- google-protobuf (~> 3.7)
70
- googleapis-common-protos-types (~> 1.0)
71
- grpc (1.21.0-x64-mingw32)
67
+ grpc (1.24.0-x86_64-linux)
72
68
  google-protobuf (~> 3.8)
73
69
  googleapis-common-protos-types (~> 1.0)
74
70
  http (4.1.1)
@@ -81,7 +77,7 @@ GEM
81
77
  http-form_data (2.1.1)
82
78
  http_parser.rb (0.6.0)
83
79
  httpclient (2.8.3)
84
- ibm_cloud_sdk_core (0.3.1)
80
+ ibm_cloud_sdk_core (0.3.3)
85
81
  concurrent-ruby (~> 1.0)
86
82
  http (~> 4.1.0)
87
83
  jwt (~> 2.2.1)
@@ -94,14 +90,14 @@ GEM
94
90
  jwt (~> 2.2.1)
95
91
  jwt (2.2.1)
96
92
  memoist (0.16.0)
97
- mime-types (3.2.2)
93
+ mime-types (3.3)
98
94
  mime-types-data (~> 3.2015)
99
- mime-types-data (3.2019.0331)
95
+ mime-types-data (3.2019.1009)
100
96
  mini_mime (1.0.2)
101
- multi_json (1.13.1)
97
+ multi_json (1.14.1)
102
98
  multipart-post (2.1.1)
103
99
  os (1.0.1)
104
- public_suffix (3.1.1)
100
+ public_suffix (4.0.1)
105
101
  rake (10.5.0)
106
102
  representable (3.0.4)
107
103
  declarative (< 0.1.0)
@@ -109,7 +105,7 @@ GEM
109
105
  uber (< 0.2.0)
110
106
  retriable (3.1.2)
111
107
  rly (0.2.3)
112
- signet (0.11.0)
108
+ signet (0.12.0)
113
109
  addressable (~> 2.3)
114
110
  faraday (~> 0.9)
115
111
  jwt (>= 1.5, < 3.0)
@@ -124,7 +120,6 @@ GEM
124
120
 
125
121
  PLATFORMS
126
122
  ruby
127
- x64-mingw32
128
123
 
129
124
  DEPENDENCIES
130
125
  bundler (~> 2.0)
@@ -117,10 +117,20 @@ module SpeechToText
117
117
  video_content_type:,
118
118
  audio_file_path:,
119
119
  audio_name:,
120
- audio_content_type:)
120
+ audio_content_type:,
121
+ **duration)
121
122
  # rubocop:enable Metrics/ParameterLists
122
- video_to_audio_command = "ffmpeg -i #{video_file_path}/#{video_name}.#{video_content_type} -ac 1 -ar 16000 #{audio_file_path}/#{audio_name}.#{audio_content_type}"
123
- system(video_to_audio_command.to_s)
123
+ if duration.empty?
124
+ video_to_audio_command = "ffmpeg -i #{video_file_path}/#{video_name}.#{video_content_type} -ac 1 -ar 16000 #{audio_file_path}/#{audio_name}.#{audio_content_type}"
125
+ system(video_to_audio_command.to_s)
126
+ elsif duration.length == 1
127
+ video_to_audio_command = "ffmpeg -ss #{0.to_i} -i #{video_file_path}/#{video_name}.#{video_content_type} -t #{duration.values[0]} -ac 1 -ar 16000 #{audio_file_path}/#{audio_name}.#{audio_content_type}"
128
+ system(video_to_audio_command.to_s)
129
+ else
130
+ video_to_audio_command = "ffmpeg -ss #{duration.values[0]} -i #{video_file_path}/#{video_name}.#{video_content_type} -t #{duration.values[1]} -ac 1 -ar 16000 #{audio_file_path}/#{audio_name}.#{audio_content_type}"
131
+ system(video_to_audio_command.to_s)
132
+ end
133
+
124
134
  end
125
135
  end
126
136
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SpeechToText
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speech_to_text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Alam
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-08 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler