tts 0.7.0 → 0.7.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 +4 -4
- data/README.rdoc +2 -1
- data/lib/tts.rb +1 -1
- data/spec/tts_spec.rb +3 -3
- data/tts.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1530e939b223c3b743f013ba42423450126d30a8
|
4
|
+
data.tar.gz: b81c2d8e4b90446d314bdc21e26f1789482f99ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dd0e163824977df01b76aba20caa94852211322237792963df8585ac693ad0e22c352595a167d106c2843810701de31b18f37e58427baa87ec50f5ff4b4c4f3
|
7
|
+
data.tar.gz: b3418c549a820f704497a8ee5f9fd8e66337e8554840950188f713fed26581bfb5c79cd3e2fee246f861b517efa73d93e565dd4fb9209c5ba05ff3659ac78e92
|
data/README.rdoc
CHANGED
@@ -44,7 +44,8 @@ You need to install `mpg123`
|
|
44
44
|
0.4 fixed issue that long text unable to generated.
|
45
45
|
0.5 added all supported languages, added direct playback feature fixed some broken rspec.
|
46
46
|
0.7 added CLI support
|
47
|
+
0.7.1 fixed new google API
|
47
48
|
|
48
49
|
== Copyright
|
49
50
|
|
50
|
-
Copyright (c) 2011 Yiling Cao /
|
51
|
+
Copyright (c) 2011 Yiling Cao / and other supporters! Check LICENSE.txt
|
data/lib/tts.rb
CHANGED
@@ -58,7 +58,7 @@ module Tts
|
|
58
58
|
def to_url lang
|
59
59
|
langs = ['af', 'ar', 'az', 'be', 'bg', 'bn', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en', 'en_us', 'en_gb', 'en_au', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fr', 'ga', 'gl', 'gu', 'hi', 'hr', 'ht', 'hu', 'id', 'is', 'it', 'iw', 'ja', 'ka', 'kn', 'ko', 'la', 'lt', 'lv', 'mk', 'ms', 'mt', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tl', 'tr', 'uk', 'ur', 'vi', 'yi', 'zh', 'zh-CN', 'zh-TW']
|
60
60
|
raise "Not accepted language, accpeted are #{langs * ","}" unless langs.include? lang
|
61
|
-
base = "#{Tts.server_url}?tl=#{lang}&ie=UTF-8&client=
|
61
|
+
base = "#{Tts.server_url}?tl=#{lang}&ie=UTF-8&client=tw-ob&q=#{URI.escape self}"
|
62
62
|
end
|
63
63
|
|
64
64
|
def fetch_mp3 url, file_name
|
data/spec/tts_spec.rb
CHANGED
@@ -33,11 +33,11 @@ end
|
|
33
33
|
|
34
34
|
describe 'to_url method' do
|
35
35
|
it "to_url should return a correct string" do
|
36
|
-
"hello".to_url("en").should == "http://translate.google.com/translate_tts?tl=en&q=hello"
|
36
|
+
"hello".to_url("en").should == "http://translate.google.com/translate_tts?tl=en&ie=UTF-8&client=tw-ob&q=hello"
|
37
37
|
end
|
38
38
|
|
39
39
|
it "to_url should return a correct string with chinese char" do
|
40
|
-
"人民广场".to_url("zh").should == "http://translate.google.com/translate_tts?tl=zh&q=%E4%BA%BA%E6%B0%91%E5%B9%BF%E5%9C%BA"
|
40
|
+
"人民广场".to_url("zh").should == "http://translate.google.com/translate_tts?tl=zh&ie=UTF-8&client=tw-ob&q=%E4%BA%BA%E6%B0%91%E5%B9%BF%E5%9C%BA"
|
41
41
|
end
|
42
42
|
|
43
43
|
end
|
@@ -90,6 +90,6 @@ describe 'set a server url' do
|
|
90
90
|
end
|
91
91
|
|
92
92
|
it "to_url should return a correct string" do
|
93
|
-
"hello".to_url("en").should == "http://127.0.0.1:3001/translate_tts?tl=en&q=hello"
|
93
|
+
"hello".to_url("en").should == "http://127.0.0.1:3001/translate_tts?tl=en&ie=UTF-8&client=tw-ob&q=hello"
|
94
94
|
end
|
95
95
|
end
|
data/tts.gemspec
CHANGED