2010-12-21 25 views
0

私はアンドロイドエミュレータとマイクを私のPCに接続しています。私は、マイクからpcmパルスをキャプチャして(つまり、音声を録音して)、udpソケットに送信したいと考えています。誰でも少なくとも音声録音のためにソースコードで私を助けてください。アンドロイドでのオーディオ録音

答えて

1

Audalyzerをチェックしてください。サンプルアプリケーションは、マイクロフォンから生のオーディオストリームをリアルタイムで読み取る方法を示しています。

2

あなたのオーディオ録音のために、このコードを使用することができます。

MediaRecorder recorder; 

void startRecording() throws IOException 
{ 
SimpleDateFormat timeStampFormat = new SimpleDateFormat(
    "yyyy-MM-dd-HH.mm.ss"); 
String fileName = "audio_" + timeStampFormat.format(new Date()) 
    + ".mp4"; 
recorder = new MediaRecorder(); 
recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); 
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 
recorder.setOutputFile("/sdcard/"+fileName); 
recorder.prepare(); 
recorder.start(); 
} 

protected void stopRecording() { 
recorder.stop(); 
recorder.release(); 
} 
+0

audiorecordのクラスはenvolve RAWデータ処理タスクに適してい..... – aProgrammer

関連する問題