txt2speech 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/txt2speech +2 -19
- data/examples/de.txt +1 -0
- data/examples/en.txt +5 -0
- data/examples/ru.txt +1 -0
- data/lib/txt2speech/application.rb +22 -0
- data/lib/txt2speech/txt2speech.rb +1 -1
- data/lib/txt2speech/version.rb +1 -1
- data/txt2speech.gemspec +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29f22ea642c96606c65fa0e64154b808bc13b22a
|
4
|
+
data.tar.gz: 5c96e6a371d72adad45ff90c08c5bd0396a4cc57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a653682d999950007c93257ea8bc369f10a6ab1512468453a16b5a5a36e7cda8404b43554d16de4f8e6bcb67cec43308efa9b5f0e2dd73a56eeb17f203034e9b
|
7
|
+
data.tar.gz: 2e0dcb388c9ae65aa458ceffb986337d2d8bfe22775a0d4fa3fd306635be69e62c2763d986e697e57a48d8717eb8c421e89e6945926d3645f61872360f0994ae
|
data/bin/txt2speech
CHANGED
@@ -1,22 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
require_relative "../lib/txt2speech"
|
3
|
+
require_relative "../lib/txt2speech/application"
|
5
4
|
|
6
|
-
|
7
|
-
OptionParser.new do |opts|
|
8
|
-
opts.banner = "Usage: txt2speech [options]"
|
9
|
-
|
10
|
-
opts.on("-o", "--output [String]", String, "Output file") {|o| options[:out] = o }
|
11
|
-
opts.on("-r", "--read [String]", String, "Read text") {|o| options[:read] = o}
|
12
|
-
opts.on("-f", "--file", "From file") {|o| options[:file] = o }
|
13
|
-
opts.on("-l", "--lang", "Language of text") {|o| options[:lang] = o }
|
14
|
-
end.parse!
|
15
|
-
|
16
|
-
out = options[:out].to_s.length > 0 ? options[:out] : "out.mp3"
|
17
|
-
|
18
|
-
attrs = [options[:read], options[:lang] || "en"]
|
19
|
-
attrs.unshift(options[:file] ? :load : :new)
|
20
|
-
|
21
|
-
f = Txt2Speech.send(*attrs)
|
22
|
-
f.save(out)
|
5
|
+
Application.new
|
data/examples/de.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Hallo Welt
|
data/examples/en.txt
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
When Tile, the square-shaped lost-item tracker that attaches to bags, bikes, key chains and more, announced this fall that it had raised $13 million in funding (a combination of a seed round and Series A investment), the company said it had earmarked some of that money to be put towards hiring more Android engineers. Now that investment has paid off, as Tile today debuts support for Android smartphones, allowing a larger group of users the ability to find missing or stolen items using their mobile device.
|
2
|
+
|
3
|
+
Tile, in case you missed it, was one of crowdfunding�s bigger hits, demonstrating both the potential that comes from raising funds directly from an interested consumer user base, but also the drawbacks. Tile initially struggled to meet its expected shipping times, and then had to struggle through a backlog once things were finally up-and-running. That backlog cleared up around Black Friday this year, and now Tile is processing orders as usual.
|
4
|
+
|
5
|
+
The company declined to provide an update on sales figures today, however, but as of October the company reported it had sold half a million devices.
|
data/examples/ru.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
привет мир
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require_relative "txt2speech"
|
3
|
+
|
4
|
+
class Application
|
5
|
+
options = {}
|
6
|
+
OptionParser.new do |opts|
|
7
|
+
opts.banner = "Usage: txt2speech [options]"
|
8
|
+
|
9
|
+
opts.on("-o", "--output [String]", String, "Output file") {|o| options[:out] = o }
|
10
|
+
opts.on("-r", "--read [String]", String, "Read text") {|o| options[:read] = o}
|
11
|
+
opts.on("-f", "--file", "From file") {|o| options[:file] = o }
|
12
|
+
opts.on("-l", "--lang [String]", String, "Language of text") {|o| options[:lang] = o }
|
13
|
+
end.parse!
|
14
|
+
|
15
|
+
out = options[:out].to_s.length > 0 ? options[:out] : "out.mp3"
|
16
|
+
|
17
|
+
attrs = [options[:read], options[:lang] || "en"]
|
18
|
+
attrs.unshift(options[:file] ? :load : :new)
|
19
|
+
|
20
|
+
f = Txt2Speech.send(*attrs)
|
21
|
+
f.save(out)
|
22
|
+
end
|
@@ -14,7 +14,7 @@ class Txt2Speech
|
|
14
14
|
|
15
15
|
def self.load(file_path, lang = 'en')
|
16
16
|
f = File.open(file_path)
|
17
|
-
self.new f.read.encode("UTF-16be", :invalid=>:replace, :replace=>"?").encode('UTF-8')
|
17
|
+
self.new f.read.encode("UTF-16be", :invalid=>:replace, :replace=>"?").encode('UTF-8'), lang
|
18
18
|
end
|
19
19
|
|
20
20
|
def save(file_path)
|
data/lib/txt2speech/version.rb
CHANGED
data/txt2speech.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Txt2Speech::VERSION
|
8
8
|
s.date = '2013-09-02'
|
9
9
|
s.summary = "txt2speech"
|
10
|
-
s.description = "
|
10
|
+
s.description = "txt2Speech lifehack of using Google Translate. Allow you to convert text into speech."
|
11
11
|
s.authors = ["Jared Levitz"]
|
12
12
|
s.email = 'jared.levitz@gmail.com'
|
13
13
|
s.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: txt2speech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Levitz
|
@@ -10,7 +10,8 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2013-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: txt2Speech lifehack of using Google Translate. Allow you to convert text
|
14
|
+
into speech.
|
14
15
|
email: jared.levitz@gmail.com
|
15
16
|
executables: []
|
16
17
|
extensions: []
|
@@ -18,7 +19,11 @@ extra_rdoc_files: []
|
|
18
19
|
files:
|
19
20
|
- README.md
|
20
21
|
- bin/txt2speech
|
22
|
+
- examples/de.txt
|
23
|
+
- examples/en.txt
|
24
|
+
- examples/ru.txt
|
21
25
|
- lib/txt2speech.rb
|
26
|
+
- lib/txt2speech/application.rb
|
22
27
|
- lib/txt2speech/txt2speech.rb
|
23
28
|
- lib/txt2speech/version.rb
|
24
29
|
- txt2speech.gemspec
|