3

I need to stop AudioRecord after 2 minutes from the starting time. With MediaRecorder I use setMaxDuration and this work well, but I need a good approach with AudioRecord too.

Thank's for help

slezadav
  • 6,104
  • 7
  • 40
  • 61
Giuseppe
  • 1,079
  • 13
  • 31
  • show the code you are using...[You can also try like this..](http://stackoverflow.com/questions/4351582/record-streaming-audio-in-java) – 5hssba Apr 15 '12 at 17:12

1 Answers1

4

You can try like this..

handler=new Handler();
 Runnable r=new Runnable() 
{
 public void run() 
{
  recorder.stop();
   recorder.release(); 
  } 

};
handler.postDelayed(r, 120000);
5hssba
  • 8,079
  • 2
  • 33
  • 35