Warning: session_start(): open(/var/lib/php/sessions/sess_v62r39hutinu9ndb81bjeqr6q7, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
import android.app.Activity;
import android.speech.tts.*;
sbool androidSay_keepEngine = false;
// locale = language, e.g. Locale.GERMAN
static void androidSay(final S text, final Locale locale) {
if (androidSay_keepEngine) {
androidSay_keepEngine(text, locale);
ret;
}
final new Flag flag;
final TextToSpeech[] tts = new TextToSpeech[1];
tts[0] = new TextToSpeech(androidContext(), new TextToSpeech.OnInitListener() {
public void onInit(int status) {
try {
if (status != TextToSpeech.SUCCESS)
fail("Speech engine initialization failed");
int result = tts[0].setLanguage(locale);
if (result == TextToSpeech.LANG_MISSING_DATA
|| result == TextToSpeech.LANG_NOT_SUPPORTED)
fail("German is not supported");
result = tts[0].setOnUtteranceProgressListener(new UtteranceProgressListener() {
public void onDone(String utteranceId) {
tts[0].shutdown();
flag.raise();
}
public void onError(String utteranceId) {
print("onError");
tts[0].shutdown();
flag.raise();
}
public void onStart(String utteranceId) {
}
});
if (result != TextToSpeech.SUCCESS)
print("Could not set listener");
print(text);
new HashMap params;
params.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, randomID(8));
tts[0].speak(text, TextToSpeech.QUEUE_FLUSH, params);
} catch (Throwable e) { e.printStackTrace(); flag.raise(); }
}
});
flag.waitUntilUp();
}