hi friends,
I wrote a code for one android application which need audio recording capability.I am using emulator , i cannot record the voice.My system have integrated microphone . Is it possible with emulator for this.
Following is my code.
package com.android.app;
import java.io.IOException;
import android.app.Activity;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Recoder extends Activity
{
public static String path=null;
public static MediaRecorder recoder=null;
Button start=null;
Button stop=null;
public void setPath(String modPath)
{
Recoder.path=modPath;
}
public void onCreate(Bundle b)
{ super.onCreate(b);
setContentView(R.layout.recoder);
this.setPath("/sdcard/myoutputfile.3gp");
start=(Button)findViewById(R.id.btnRecord);
start.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
recoder=new MediaRecorder();
recoder.setAudioSource(MediaRecorder.AudioSource.MIC);
recoder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
recoder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recoder.setOutputFile(Recoder.path);
try
{recoder.prepare();
recoder.start();
}catch(IOException e)
{}
}
});
stop=(Button)findViewById(R.id.btnStop);
stop.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
recoder.stop();
}
}
);
}
}
with regards,
vijeesh kumar
I wrote a code for one android application which need audio recording capability.I am using emulator , i cannot record the voice.My system have integrated microphone . Is it possible with emulator for this.
Following is my code.
package com.android.app;
import java.io.IOException;
import android.app.Activity;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Recoder extends Activity
{
public static String path=null;
public static MediaRecorder recoder=null;
Button start=null;
Button stop=null;
public void setPath(String modPath)
{
Recoder.path=modPath;
}
public void onCreate(Bundle b)
{ super.onCreate(b);
setContentView(R.layout.recoder);
this.setPath("/sdcard/myoutputfile.3gp");
start=(Button)findViewById(R.id.btnRecord);
start.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
recoder=new MediaRecorder();
recoder.setAudioSource(MediaRecorder.AudioSource.MIC);
recoder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
recoder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recoder.setOutputFile(Recoder.path);
try
{recoder.prepare();
recoder.start();
}catch(IOException e)
{}
}
});
stop=(Button)findViewById(R.id.btnStop);
stop.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
recoder.stop();
}
}
);
}
}
with regards,
vijeesh kumar