android AudioTrack不能播放awr(2)
btnStart = (Button)this.findViewById(R.id.btn_start);
btnStop = (Button)this.findViewById(R.id.btn_stop);
btnPlay = (Button)this.findViewById(R.id.btn_play);
btnFinish = (Button)this.findViewById(R.id.btn_finish);
btnFinish.setText("停止播放");
btnPlay.setEnabled(false);
btnFinish.setEnabled(false);
btnStart.setOnClickListener(this);
btnStop.setOnClickListener(this);
btnPlay.setOnClickListener(this);
btnFinish.setOnClickListener(this);
// File fpath = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/11");
// fpath.mkdirs();
try {
//audioFile = File.createTempFile("test", ".pcm", fpath);
audioFile = new File("/mnt/sdcard/1.pcm");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void onClick(View v){
int id = v.getId();
switch(id){
case R.id.btn_start:
recorder = new RecordTask();
recorder.execute();
break;
case R.id.btn_stop:
相关新闻>>
- 发表评论
-
- 最新评论 更多>>