tts 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/tts.rb +5 -0
- data/tts.gemspec +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -3,9 +3,13 @@
|
|
3
3
|
Using the Google Translate service as the speech engine, this gem generates a .mp3 voice file from any given string.
|
4
4
|
|
5
5
|
== Usage
|
6
|
+
require 'tts'
|
6
7
|
# Will download "Hello World!.mp3" to your current directory
|
7
8
|
# Supported languages: ["zh", "en", "it", "fr"]
|
8
9
|
"Hello World!".to_file "en"
|
10
|
+
|
11
|
+
# i18n
|
12
|
+
"人民代表代表人民".to_file "zh"
|
9
13
|
|
10
14
|
# Save the file to a specific location
|
11
15
|
"Light rain with highs of 5 degrees".to_file "en", "~/weather.mp3"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/tts.rb
CHANGED
@@ -6,6 +6,11 @@ module Tts
|
|
6
6
|
@@default_url = "http://translate.google.com/translate_tts"
|
7
7
|
@@user_agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24"
|
8
8
|
|
9
|
+
def self.server_url url=nil
|
10
|
+
return @@default_url if url.nil?
|
11
|
+
@@default_url = url
|
12
|
+
end
|
13
|
+
|
9
14
|
def to_file lang, file_name=nil
|
10
15
|
parts = validate_text_length(self)
|
11
16
|
file_name = generate_file_name(self[0..20]) if file_name.nil?
|
data/tts.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
segments:
|
109
109
|
- 0
|
110
|
-
hash: -
|
110
|
+
hash: -3856335745292823926
|
111
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
112
|
none: false
|
113
113
|
requirements:
|