Advertisement
Guest User

RecordAudio.java

a guest
May 17th, 2010
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. package saic.media.audio.clint;
  2.  
  3. import java.io.IOException;
  4.  
  5. import android.app.Activity;
  6. import android.os.Bundle;
  7. import android.view.View;
  8. import android.view.View.OnClickListener;
  9. import android.widget.Button;
  10. import android.widget.TextView;
  11.  
  12. public class RecordAudio extends Activity {
  13.     /** Called when the activity is first created. */
  14.     TextView test;
  15.     @Override
  16.     public void onCreate(Bundle savedInstanceState) {
  17.         super.onCreate(savedInstanceState);
  18.         setContentView(R.layout.main);
  19.         final AudioHelper audio = new AudioHelper("test/tmp.3gp");
  20.         Button btnRecord = (Button) findViewById(R.id.btnRecordAudio);
  21.         btnRecord.setOnClickListener(new OnClickListener() {
  22.             @Override
  23.             public void onClick(View v) {
  24.                 try {
  25.                     audio.start();
  26.                 } catch (IOException e) {
  27.                     // TODO Auto-generated catch block
  28.                     e.printStackTrace();
  29.                 }
  30.             }
  31.           });
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement