如何将合成的语音文保存成音频文件啊??
Ta的回复 :合成的语音数据可以通过onSynthesizeDataArrived回调方法获取到,可以通过下面的代码保存合成后的语音数据 public void onSynthesizeDataArrived(String utteranceId, byte[] data, int progress) { Log.v("Mian", " datalength=" + data.length + " progress=" + progress + " i=" + (++i)); mHandler.sendMessage(mHandler.obtainMessage(UI_CHANGE_SYNTHES_TEXT_SELECTION, progress, 0)); toPrint("onSynthesizeDataArrived"); File file = new File(mSampleDirPath + "/" + "audio.pcm"); if (!file.exists()) { try { file.createNewFile(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } try { FileOutputStream fos = new FileOutputStream(file, true); fos.write(data); fos.flush(); fos.close(); } catch (Exception e) { e.printStackTrace(); } }