Skip to content

Commit 71a8cca

Browse files
committed
Fixed to make synthesizer v1.0 work with the new captcha'd speech api.
1 parent 1b244ed commit 71a8cca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/com/darkprograms/speech/synthesiser/Synthesiser.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,12 @@ public InputStream getMP3Data(String synthText) throws IOException{
116116
return out;
117117
}
118118

119-
120119
String encoded = URLEncoder.encode(synthText, "UTF-8"); //Encode
121120

122-
URL url = new URL(GOOGLE_SYNTHESISER_URL + languageCode + "&q=" + encoded); //create url
123-
121+
URL url = new URL(GOOGLE_SYNTHESISER_URL + languageCode + "&q=" + encoded + "&ie=UTF-8&total=1&idx=0&client=t");
124122
// Open New URL connection channel.
125123
URLConnection urlConn = url.openConnection(); //Open connection
126-
124+
127125
urlConn.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0"); //Adding header for user agent is required
128126

129127
return urlConn.getInputStream();

0 commit comments

Comments
 (0)