txt2speech 0.7 → 0.9

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: 0ce8d7e048b1003c3d8f94aa85984a180b68f63f
4
- data.tar.gz: e27c25c110173405d91b89bda9a3a92beeb1503e
3
+ metadata.gz: 5133c8bc434553c7bda4b58fdbb7b1ef60854348
4
+ data.tar.gz: 5db3ac6a8f615dcc506409b79dfe1ee5a318c2e6
5
5
  SHA512:
6
- metadata.gz: 1842088ccd9542de7a369b07ee74e3c331ce36ebb0992ab60da85b70f001077fbc4d2b374f5f6947f5a2d9cf158e41b993906caf912a3ab3e7c44b0fea1c7c82
7
- data.tar.gz: 44b558edc9cd828ac08c55e4269675dc275777d64f1301ecfc30f3e6e00a6e7a5f2990fab586762591a2a51d3c7ab4616fd96a4c6ce3ee0af66cbc36116ac798
6
+ metadata.gz: 699c606c2a03c7e18a4f4d3dd31f923d8634ec84f869db9281d0433a8760acb95cce9d30666f1e5c5a454a968bddb649cea2a6e8a9bbfa12c04f7eb48796a36c
7
+ data.tar.gz: 5c3198184178eb77c0874cfe4696948ee79fa19d4ac6a9797df5c20fc175d515bca3adfbea83a56c1fdd5d6c1532b259bdd25569cf848041176984fafb1fc250
data/README.md CHANGED
@@ -1,18 +1,12 @@
1
- [![Build Status](https://travis-ci.org/rudkovsky/txt2speech.svg)](https://travis-ci.org/rudkovsky/txt2speech)
1
+ [![Build Status](https://travis-ci.org/rudkovskyi/txt2speech.svg?branch=master)](https://travis-ci.org/rudkovsky/txt2speech)
2
2
 
3
- txt2Speech lifehack of using Google Translate. Allow you to convert text into speech.
3
+ txt2Speech is a library that with a help of Google Translate let you convert your text to speech
4
4
 
5
5
  ```
6
6
  bin/txt2speech -r README.md -f -o example.mpg
7
7
  ```
8
8
 
9
- to change language to read
10
-
11
- ```
12
- bin/txt2speech -r examples/de.txt -f -l de
13
- ```
14
-
15
- ### To use library directly in your application just install gem and run
9
+ ### To use library directly in your application just install gem and run
16
10
 
17
11
  ```
18
12
  2.1.2 :001 > require 'txt2speech'
@@ -29,28 +23,3 @@ or you can load a text file to read it
29
23
  => #<Txt2Speech::Speech:0x000000022314f8 @text="txt2Speech is a simple ruby script that convert text to speech by using Google Translate.\r\n\r\n```\r\n2.1.2 :001 > require './txt2speech.rb'\r\n => true\r\n2.1.2 :002 > f = Txt2Speech.new \"Hello I am google! Nice to meet you\"\r\n => #<Txt2Speech:0x000000018aafd8 @text=\"Hello I am google! Nice to meet you\", @lang=\"en\">\r\n2.1.2 :003 > f.save(\"out.mpg\")\r\n => \"out.mpg\"\r\n```\r\n\r\nor you can load a text file to read it\r\n\r\n```\r\nt = Txt2Speech.load \"\#{Dir.home}/text.txt\"\r\nt.save(\"out.mpg\")\r\n```", @lang="en">
30
24
  2.1.2 :007 > f.save("out.mpg")
31
25
  ```
32
-
33
- Supplemental publishing:
34
- [Text to Speech? Lifehack of using Google Translate](http://jaredlevitz.com/post/105204717375/text-to-speech-lifehack-of-using-google-translate)
35
-
36
- The MIT License (MIT)
37
-
38
- Copyright (c) 2014 Viacheslav Rudkovskyi <rrubyist@gmail.com>
39
-
40
- Permission is hereby granted, free of charge, to any person obtaining a copy
41
- of this software and associated documentation files (the "Software"), to deal
42
- in the Software without restriction, including without limitation the rights
43
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
- copies of the Software, and to permit persons to whom the Software is
45
- furnished to do so, subject to the following conditions:
46
-
47
- The above copyright notice and this permission notice shall be included in
48
- all copies or substantial portions of the Software.
49
-
50
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
56
- THE SOFTWARE.
@@ -30,13 +30,13 @@ module Txt2Speech
30
30
  puts ar.inspect
31
31
 
32
32
  ar.each_with_index do |q, idx|
33
- uri.query = URI.encode_www_form({ ie: 'UTF-8', q: q, tl: lang, total: ar.length, idx: 0, textlen: q.length, client: 't', prev: 'input' })
33
+ uri.query = URI.encode_www_form({ ie: 'UTF-8', q: q, tl: lang, total: ar.length, idx: 0, textlen: q.length, client: 'tw-ob', prev: 'input' })
34
34
  res = Net::HTTP.get_response(uri)
35
35
 
36
36
  response << res.body.force_encoding(Encoding::UTF_8) if res.is_a?(Net::HTTPSuccess)
37
37
  end
38
38
 
39
- File.open(file_path, 'wb') do |f|
39
+ File.open(file_path, 'wb') do |f|
40
40
  f.write response.join
41
41
  return f.path
42
42
  end
@@ -51,7 +51,7 @@ module Txt2Speech
51
51
  starts = 0
52
52
  ar = []
53
53
 
54
- attempts.ceil.times do
54
+ attempts.ceil.times do
55
55
  ends = starts + 150
56
56
  ar << text[starts...ends]
57
57
  starts = ends
@@ -1,3 +1,3 @@
1
1
  module Txt2Speech
2
- VERSION = '0.7'
2
+ VERSION = '0.9'
3
3
  end
data/spec/speech_spec.rb CHANGED
@@ -20,6 +20,7 @@ RSpec.describe Txt2Speech::Speech, '#new' do
20
20
  after(:each) do
21
21
  @speech.save(output_path)
22
22
  expect(File.exists?(output_path)).to eq(true)
23
+ expect(File.size(output_path)).to be > 0
23
24
  [output_path, "/tmp/txt2speech.txt"].each do |f|
24
25
  FileUtils.rm(f) if File.exists?(f)
25
26
  end
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.7'
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viacheslav Rudkovskyi
@@ -25,10 +25,7 @@ files:
25
25
  - README.md
26
26
  - Rakefile
27
27
  - bin/txt2speech
28
- - examples/de.txt
29
- - examples/en.txt
30
28
  - examples/rss_reader.rb
31
- - examples/ru.txt
32
29
  - lib/txt2speech.rb
33
30
  - lib/txt2speech/application.rb
34
31
  - lib/txt2speech/speech.rb
@@ -56,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
53
  version: '0'
57
54
  requirements: []
58
55
  rubyforge_project:
59
- rubygems_version: 2.2.2
56
+ rubygems_version: 2.5.1
60
57
  signing_key:
61
58
  specification_version: 4
62
59
  summary: txt2speech
data/examples/de.txt DELETED
@@ -1 +0,0 @@
1
- Hallo Welt
data/examples/en.txt DELETED
@@ -1,5 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- привет мир