Comment conserver le texte à la parole de sortie comme le fichier WAV?

J'utilise le code suivant pour stocker Text to Speech sortie wav fichier dans mon application. Je ne sais pas où est l'erreur, pouvez vous s'il vous plaît prendre un coup d'oeil et me suggérer?

public class MainActivity extends Activity {
Button store, play;
EditText input;
String speakTextTxt;
TextToSpeech mTts;
HashMap<String, String> myHashRender = new HashMap<String, String>();
String tempDestFile ;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
store = (Button) findViewById(R.id.button1);
play = (Button) findViewById(R.id.button2);
input = (EditText) findViewById(R.id.editText1);
store.setOnClickListener(new OnClickListener()  {
public void onClick(View v) {
speakTextTxt = "Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world";
HashMap<String, String> myHashRender = new HashMap<String, String>();
myHashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, speakTextTxt);
String exStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath();
File appTmpPath = new File(exStoragePath + "/sounds/");
appTmpPath.mkdirs();
String tempFilename = "hello.mp3";
tempDestFile = appTmpPath.getAbsolutePath() + "/" + tempFilename;
new MySpeech(speakTextTxt);
}
});
}
class MySpeech implements OnInitListener
{
String tts;
public MySpeech(String tts)
{
this.tts = tts;
mTts = new TextToSpeech(MainActivity.this, this);
}
@Override
public void onInit(int status) 
{
Log.v("log", "initi");
int i = mTts.synthesizeToFile(speakTextTxt, myHashRender, tempDestFile);
if(i == TextToSpeech.SUCCESS)
{
Toast toast = Toast.makeText(MainActivity.this, "Saved "+i,
Toast.LENGTH_SHORT);
toast.show();   
}
System.out.println("Result : " + i);
}
}
}
Fichier appTmpPath = new File(exStoragePath + "/sekhar/"); ... tempDestFile = appTmpPath.getAbsolutePath() + "/"+ tempFilename; il n'existe pas de deux '//' à votre nom de fichier?
Par erreur je l'ai ajouté à de multiples reprises. Maintenant, je l'ai enlevé et j'ai essayé. J'ai eu le toast de méthode onInIt qui est dans la sous-classe. Maintenant, je comment puis-je vérifier wehter il est enregistré ou non. J'ai connecté mon appareil à mon ordinateur et vérifié les sekhar dossier. Mais il n'existe pas de fichier wav. Pouvez vous s'il vous plaît me suggérer? J'ai imprimé la valeur de "i" est de 0.
ce texte votre instance de MySpeachn'a parlé ??
il doit parlé de ce que je donne comme entrée dans l'EditText
mais je ne peux pas voir les instructions dans le code ci-dessus qui dit à votre instance de prononcer le texte de la EditText

OriginalL'auteur ChandraSekhar | 2013-02-04