pollynomial 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f905301e627be7609e1c02a0931c083fc3bca78c
4
- data.tar.gz: 584f8c6a5d48ab183f11ff40327ebfa2938f0eea
3
+ metadata.gz: e74277511351d13cb151080ad4da18b94dfc82d0
4
+ data.tar.gz: 7a62018e89752e48e8bd67e83400af5ce09defaa
5
5
  SHA512:
6
- metadata.gz: 4ac53501ea940f1694af99f54507a26546599b5a2c628375e1610f6ecd6a6ee3a6d15be9c35661683d3207167f06d248f9f395c90e02ca550529c309d137c7a1
7
- data.tar.gz: 1c249a19bcc57c376c7de063e49c618fd574f287d856140f8da1dd3a7f5acdaa829053b0e3c68b07bdb44eeb3679330d249daf2d160a1ab9d900c08564d11b8b
6
+ metadata.gz: df75738695b1021c675f21f653af9611030d9d97e8bb27b0296e0bfc72bbf015d96f8ed9ab6cfb0aa457c92c593b5220d8aa84971cdf72a7c8e8e102dac01c94
7
+ data.tar.gz: 554859203e43d0fc8ce429767c575ed1afef222ddfc6bff36efedf853a1061dd4b7c904f933580ad18a63079ae921953d909c9d1276e7fb990a49380389ed664
data/README.md CHANGED
@@ -20,6 +20,11 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
+ ```rb
24
+ synthesizer = Pollynomial::Synthesizer.new(options)
25
+ synthesizer.synthesize(text, file_name: output)
26
+ ```
27
+
23
28
  There is a executable command `text2mp3`. You can use as following.
24
29
 
25
30
  ```
@@ -2,12 +2,35 @@
2
2
 
3
3
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
4
4
  require 'pollynomial'
5
- require 'optparse'
6
-
7
- params = ARGV.getopts("v:", "r:", "o:")
8
- file_name= ARGV.shift
9
- text = File.open(file_name).read
10
- options = {voice_id: params['v'], region: params["r"]}
11
- output = params["o"] || 'tmp.mp3'
12
- synthesizer = Pollynomial::Synthesizer.new(options)
13
- synthesizer.synthesize(text, file_name: output)
5
+ require 'docopt'
6
+ require 'pry'
7
+ doc = <<DOCOPT
8
+ text2mp3 is convert your text into mp3 using AWS Polly.
9
+ It is assumed to set AWS credentials in environmental variables.
10
+
11
+ Usage:
12
+ #{__FILE__} -h | --help
13
+ #{__FILE__} [--voiceid=<voiceid>] [--region=<region>] [-o <outfile>] [-s <rate>] <path>
14
+
15
+ Options:
16
+ -h, --help Show this help
17
+ --voiceid=<voiceid> Voice ID of AWS Polly
18
+ -r, --region <region> AWS region name [dfault: us-east-1]
19
+ -o, --output <outfile> Output file name [default: tmp.mp3]
20
+ -s, --samplerate <rate> Sampling rate of output file [default: 16000]
21
+
22
+ DOCOPT
23
+
24
+ begin
25
+ params = Docopt::docopt(doc)
26
+
27
+ file_name= params["<path>"]
28
+ text = File.open(file_name).read
29
+ options = {voice_id: params["--voiceid"], region: params["--region"], sample_rate: params["--samplerate"]}
30
+ output = params["--output"]
31
+ synthesizer = Pollynomial::Synthesizer.new(options)
32
+ synthesizer.synthesize(text, file_name: output)
33
+ rescue Docopt::Exit => e
34
+ puts e.message
35
+ end
36
+
@@ -1,3 +1,3 @@
1
1
  module Pollynomial
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "pry", "~> 0.10"
37
37
  spec.add_development_dependency "pry-byebug", "~> 3.4"
38
38
  spec.add_dependency "aws-sdk-polly", "1.0.0.rc2"
39
+ spec.add_dependency "docopt", "0.5.0"
39
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pollynomial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michiaki Ariga
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.0.0.rc2
97
+ - !ruby/object:Gem::Dependency
98
+ name: docopt
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.5.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.5.0
97
111
  description: AWS polly wrapper, converts from text into speech audio.
98
112
  email:
99
113
  - chezou@gmail.com