diff --git a/app/src/main/java/org/ntlab/amaryllis/client/VoiceActivity.java b/app/src/main/java/org/ntlab/amaryllis/client/VoiceActivity.java index 8425287..68703ee 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/VoiceActivity.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/VoiceActivity.java @@ -204,11 +204,17 @@ if(StartChange == 0) { try { + in = new FileInputStream(file); TextView textView1 = (TextView)findViewById(R.id.Notice); textView1.setText("Record End!"); mr.stop(); mr.reset(); mr.release(); + + in.read(byteData); + byte2short(shortData, byteData); + Base64.encodeToString(byteData, 0,byteData.length, Base64.DEFAULT); + StartChange = 1; } catch (Exception e) { e.printStackTrace(); @@ -217,7 +223,7 @@ try { TextView textView1 = (TextView)findViewById(R.id.Notice); textView1.setText("Record Start!"); - in = new FileInputStream(file); + mr = new MediaRecorder(); mr.setAudioSource(MediaRecorder.AudioSource.MIC); mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); @@ -226,9 +232,6 @@ mr.setOutputFile(file.getAbsolutePath()); //mr.setOutputFile(filePath); - in.read(byteData); - byte2short(shortData, byteData); - Base64.encodeToString(byteData, 0,byteData.length, Base64.DEFAULT); mr.prepare(); mr.start();