L
lifecheaterz
Neues Mitglied
- 0
heyy leute ich bin neu in der welt der android-programmierung und versuchte mein glück zuerst an einer einfachen TextToSpeech app irgendwie will es bei mir nicht funktionieren kann mir vlt jemand helfen hier mein code: package my.lifecheaterzz.talktome;
import java.util.Locale;
import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class TalkToMeActivity extends Activity implements OnInitListener {
private TextToSpeech tts;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tts = new TextToSpeech(this, this);
}
@Override
public void onInit(int arg0) {
tts.setLanguage(Locale.GERMAN);
Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(this);
}
@Override
public void onClick(View view) {
EditText et = (EditText) findViewById(R.id.editText1);
tts.speak(et.getText().toString(), TextToSpeech.QUEUE_FLUSH, null);
}
}
ich bin schon kurz vorm verzweifeln.
danke schon mal im vorraus
lifecheaterz
Der ursprüngliche Beitrag von 20:26 Uhr wurde um 20:28 Uhr ergänzt:
eclipse-android-handy-programming-programmierung-texttospeech-hilfe
import java.util.Locale;
import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class TalkToMeActivity extends Activity implements OnInitListener {
private TextToSpeech tts;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tts = new TextToSpeech(this, this);
}
@Override
public void onInit(int arg0) {
tts.setLanguage(Locale.GERMAN);
Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(this);
}
@Override
public void onClick(View view) {
EditText et = (EditText) findViewById(R.id.editText1);
tts.speak(et.getText().toString(), TextToSpeech.QUEUE_FLUSH, null);
}
}
ich bin schon kurz vorm verzweifeln.
danke schon mal im vorraus
lifecheaterz
Der ursprüngliche Beitrag von 20:26 Uhr wurde um 20:28 Uhr ergänzt:
eclipse-android-handy-programming-programmierung-texttospeech-hilfe