diff --git a/app/src/main/java/org/ntlab/amaryllis/client/VoiceTest.java b/app/src/main/java/org/ntlab/amaryllis/client/VoiceTest.java index c7f2210..7dfb80d 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/VoiceTest.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/VoiceTest.java @@ -8,8 +8,10 @@ import android.view.View; import android.widget.Button; import android.widget.LinearLayout; +import android.widget.TextView; import java.io.File; +import java.io.OutputStream; public class VoiceTest extends AppCompatActivity { @@ -29,6 +31,8 @@ try { //mp = new MediaPlayer(); mp.setDataSource(file.getAbsolutePath()); + //OutputStream filePath = openFileOutput("a",MODE_PRIVATE); + //mp.setDataSource(filePath); mp.prepare(); mp.start(); }catch(Exception e){ @@ -54,8 +58,8 @@ mr.setAudioSource(MediaRecorder.AudioSource.MIC); mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); - //mr.setOutputFile(file.getAbsolutePath()); - mr.setOutputFile(filePath); + mr.setOutputFile(file.getAbsolutePath()); + //mr.setOutputFile(filePath); mr.prepare(); mr.start(); @@ -85,6 +89,8 @@ Button Rokuon = (Button)findViewById(R.id.button2); Rokuon.setOnClickListener(new View.OnClickListener(){ public void onClick(View x){ + TextView textView1 = (TextView)findViewById(R.id.text); + textView1.setText("Rokuon Start!"); startRecord(); } }); @@ -92,6 +98,8 @@ Button Teisi = (Button)findViewById(R.id.button3); Teisi.setOnClickListener(new View.OnClickListener(){ public void onClick(View x){ + TextView textView1 = (TextView)findViewById(R.id.text); + textView1.setText("Rokuon Stop!"); stopRecord(); } }); @@ -99,6 +107,8 @@ Button Saisei = (Button)findViewById(R.id.button4); Saisei.setOnClickListener(new View.OnClickListener(){ public void onClick(View x){ + TextView textView1 = (TextView)findViewById(R.id.text); + textView1.setText("Saisei Start!"); startPlay(); } });