espeak-ruby 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of espeak-ruby might be problematic. Click here for more details.

Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/espeak/speech.rb +22 -0
  3. metadata +12 -13
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 180cad066c032c06a849a41fc576ec2c92e7467a
4
+ data.tar.gz: 5a246834822ad4abd75c9b270ebd760e3330b263
5
+ SHA512:
6
+ metadata.gz: 5d1fce395e5c3a91c84f4a6103f2582ade114792d21cff4128d237b3d07c7c98553b876c6eff0f88f024a877412fe5c1ec9f19a3bd35910318a2713b86f20e34
7
+ data.tar.gz: 00f1b281b7f5f5aa7851ecd98714136140a5541fe2d94290e8bc83904d11cca40a8bc4600fcbe998f25006be7daf72a4187d05a19dee4044b2984f279c9753c6
@@ -1,3 +1,5 @@
1
+ require 'open3.rb'
2
+
1
3
  module ESpeak
2
4
  class Speech
3
5
  attr_reader :options, :text
@@ -27,6 +29,22 @@ module ESpeak
27
29
  system(espeak_command(command_options, "--stdout") + " | " + lame_command(filename, command_options))
28
30
  end
29
31
 
32
+ # Returns mp3 file bytes as a result of
33
+ # Text-To-Speech conversion.
34
+ #
35
+ def bytes()
36
+ stdout_str, stderr_str, process = Open3.capture3(espeak_command(command_options, "--stdout") + " | " + std_lame_command(command_options))
37
+ stdout_str
38
+ end
39
+
40
+ # Returns wav file bytes as a result of
41
+ # Text-To-Speech conversion.
42
+ #
43
+ def bytes_wav()
44
+ stdout_str, stderr_str, process = Open3.capture3(espeak_command(command_options, "--stdout"))
45
+ stdout_str
46
+ end
47
+
30
48
  # espeak dies handling some chars
31
49
  # this function sanitizes text
32
50
  #
@@ -55,6 +73,10 @@ module ESpeak
55
73
  %|espeak "#{sanitized_text}" #{flags} -v#{options[:voice]} -p#{options[:pitch]} -s#{options[:speed]}|
56
74
  end
57
75
 
76
+ def std_lame_command(options)
77
+ lame_command("-", options)
78
+ end
79
+
58
80
  def lame_command(filename, options)
59
81
  "lame -V2 - #{filename} #{'--quiet' if options[:quiet] == true}"
60
82
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: espeak-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
5
- prerelease:
4
+ version: 1.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dejan Simic
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: espeak-ruby is small Ruby API for utilizing ‘espeak’ and ‘lame’ to create
15
14
  Text-To-Speech mp3 files
@@ -18,38 +17,38 @@ executables: []
18
17
  extensions: []
19
18
  extra_rdoc_files: []
20
19
  files:
20
+ - README.md
21
21
  - Rakefile
22
+ - lib/espeak.rb
22
23
  - lib/espeak/speech.rb
23
24
  - lib/espeak/voice.rb
24
- - lib/espeak.rb
25
25
  - test/cases/speech_test.rb
26
26
  - test/cases/voice_test.rb
27
27
  - test/fixtures/voices.txt
28
28
  - test/test_helper.rb
29
- - README.md
30
- homepage: http://github.com/dejan/espeak-ruby
31
- licenses: []
29
+ homepage: https://github.com/dejan/espeak-ruby
30
+ licenses:
31
+ - MIT
32
+ metadata: {}
32
33
  post_install_message:
33
34
  rdoc_options: []
34
35
  require_paths:
35
36
  - lib
36
37
  required_ruby_version: !ruby/object:Gem::Requirement
37
- none: false
38
38
  requirements:
39
- - - ! '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  required_rubygems_version: !ruby/object:Gem::Requirement
43
- none: false
44
43
  requirements:
45
- - - ! '>='
44
+ - - ">="
46
45
  - !ruby/object:Gem::Version
47
46
  version: '0'
48
47
  requirements: []
49
48
  rubyforge_project:
50
- rubygems_version: 1.8.23
49
+ rubygems_version: 2.4.5
51
50
  signing_key:
52
- specification_version: 3
51
+ specification_version: 4
53
52
  summary: espeak-ruby is small Ruby API for utilizing ‘espeak’ and ‘lame’ to create
54
53
  Text-To-Speech mp3 files
55
54
  test_files: []