help me I need text to speech on android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
help me I need text to speech on android
I made a app for education of language,
and the app need text to speech
who can show me the way ?
help me please
and the app need text to speech
who can show me the way ?
help me please
Re: help me I need text to speech on android
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: help me I need text to speech on android
As Mark says you need an external. Unfortunately, there is no Android Externals SDK from Runrev, so how to make Android externals will be complex and undocumented.
I don't know of anyone making Android externals that will give you text to speech on Android.
IMO -- if you really must have text to speech in Android, I would stop using LC and go native, or use one of the other programming environments that will do what you want.
Paul
I don't know of anyone making Android externals that will give you text to speech on Android.
IMO -- if you really must have text to speech in Android, I would stop using LC and go native, or use one of the other programming environments that will do what you want.
Paul
Re: help me I need text to speech on android
Hi sunkim,
I've used Googles text to speech
http://translate.google.com/translate_t ... to%20speak
i think it's limited to 10 seconds for each sentence. Oh and it's not officially supported.
Simon
I've used Googles text to speech
http://translate.google.com/translate_t ... to%20speak
i think it's limited to 10 seconds for each sentence. Oh and it's not officially supported.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: help me I need text to speech on android
thank you for your advicepaul_gr wrote:As Mark says you need an external. Unfortunately, there is no Android Externals SDK from Runrev, so how to make Android externals will be complex and undocumented.
I don't know of anyone making Android externals that will give you text to speech on Android.
IMO -- if you really must have text to speech in Android, I would stop using LC and go native, or use one of the other programming environments that will do what you want.
Paul
very much.
Re: help me I need text to speech on android
hi simon
thank you for reply,
it is good news to me
thank you very much
thank you for reply,
it is good news to me
thank you very much
Re: help me I need text to speech on android
below this is an example of google TTS API for android of java,
can I use this in livecode?
package com.nxhoaf;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
public class SimpleTextToSpeech {
private static final String TEXT_TO_SPEECH_SERVICE =
"http://translate.google.com/translate_tts";
private static final String USER_AGENT =
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) " +
"Gecko/20100101 Firefox/11.0";
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.out.println("Usage: SimpleTextToSpeech " +
"where: ");
System.out.println();
System.out.println("- Language: all languages accepted by " +
"google translate, in this example, we'll use fr, en");
System.out.println("- Text : If text is more than one word, " +
"then is must be put inside double quote, for example:");
System.out.println("\tjava SimpleTextToSpeech en Hello");
System.out.println("\tjava SimpleTextToSpeech en \"Hello World\"");
System.exit(1);
}
Language language = Language.valueOf(args[0].toUpperCase());
String text = args[1];
text = URLEncoder.encode(text, "utf-8");
new SimpleTextToSpeech().go(language, text);
}
public void go(Language language, String text) throws Exception {
// Create url based on input params
String strUrl = TEXT_TO_SPEECH_SERVICE + "?" +
"tl=" + language + "&q=" + text;
URL url = new URL(strUrl);
// Etablish connection
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// Get method
connection.setRequestMethod("GET");
// Set User-Agent to "mimic" the behavior of a web browser. In this
// example, I used my browser's info
connection.addRequestProperty("User-Agent", USER_AGENT);
connection.connect();
// Get content
BufferedInputStream bufIn =
new BufferedInputStream(connection.getInputStream());
byte[] buffer = new byte[1024];
int n;
ByteArrayOutputStream bufOut = new ByteArrayOutputStream();
while ((n = bufIn.read(buffer)) > 0) {
bufOut.write(buffer, 0, n);
}
// Done, save data
File output = new File("output.mp3");
BufferedOutputStream out =
new BufferedOutputStream(new FileOutputStream(output));
out.write(bufOut.toByteArray());
out.flush();
out.close();
System.out.println("Done");
}
public enum Language {
FR("french"),
EN("english");
private final String language;
private Language(String language) {
this.language = language;
}
public String getFullName() {
return language;
}
}
}
--[from]- http://www.androidside.com/B56/23972
can I use this in livecode?
package com.nxhoaf;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
public class SimpleTextToSpeech {
private static final String TEXT_TO_SPEECH_SERVICE =
"http://translate.google.com/translate_tts";
private static final String USER_AGENT =
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) " +
"Gecko/20100101 Firefox/11.0";
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.out.println("Usage: SimpleTextToSpeech " +
"where: ");
System.out.println();
System.out.println("- Language: all languages accepted by " +
"google translate, in this example, we'll use fr, en");
System.out.println("- Text : If text is more than one word, " +
"then is must be put inside double quote, for example:");
System.out.println("\tjava SimpleTextToSpeech en Hello");
System.out.println("\tjava SimpleTextToSpeech en \"Hello World\"");
System.exit(1);
}
Language language = Language.valueOf(args[0].toUpperCase());
String text = args[1];
text = URLEncoder.encode(text, "utf-8");
new SimpleTextToSpeech().go(language, text);
}
public void go(Language language, String text) throws Exception {
// Create url based on input params
String strUrl = TEXT_TO_SPEECH_SERVICE + "?" +
"tl=" + language + "&q=" + text;
URL url = new URL(strUrl);
// Etablish connection
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// Get method
connection.setRequestMethod("GET");
// Set User-Agent to "mimic" the behavior of a web browser. In this
// example, I used my browser's info
connection.addRequestProperty("User-Agent", USER_AGENT);
connection.connect();
// Get content
BufferedInputStream bufIn =
new BufferedInputStream(connection.getInputStream());
byte[] buffer = new byte[1024];
int n;
ByteArrayOutputStream bufOut = new ByteArrayOutputStream();
while ((n = bufIn.read(buffer)) > 0) {
bufOut.write(buffer, 0, n);
}
// Done, save data
File output = new File("output.mp3");
BufferedOutputStream out =
new BufferedOutputStream(new FileOutputStream(output));
out.write(bufOut.toByteArray());
out.flush();
out.close();
System.out.println("Done");
}
public enum Language {
FR("french"),
EN("english");
private final String language;
private Language(String language) {
this.language = language;
}
public String getFullName() {
return language;
}
}
}
--[from]- http://www.androidside.com/B56/23972
Re: help me I need text to speech on android
Hi sunkim,
Nope, you just use a url like I posted.
It doesn't show well in the post but click it and look at your address bar.
Simon
Nope, you just use a url like I posted.
It doesn't show well in the post but click it and look at your address bar.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: help me I need text to speech on android
Here is the url
I'd try it in a different browser to see if you can get it to work. Works here.
Simon
All you need to do is change what is said after "q="
I'd try it in a different browser to see if you can get it to work. Works here.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: help me I need text to speech on android
hi simon
thank you
I connected the url of you
and I knew TTS of google
and I think there is a way to use TTS of google in livecode that I don't know.
but I'm a beginner,
and can little speak english
thank you
I connected the url of you
and I knew TTS of google
and I think there is a way to use TTS of google in livecode that I don't know.
but I'm a beginner,
and can little speak english