找到你要的答案

Q:Use Media recorder to record audio and static image in android

Q:使用媒体记录器在Android中录制音频和静态图像

I record audio files with the following:

private void startRecording(){
    recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(output_formats[currentFormat]);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    recorder.setOutputFile(getFilename(count_sound));
    recorder.setMaxDuration(30000);
    recorder.setOnErrorListener(errorListener);
    recorder.setOnInfoListener(infoListener);


    try {
        recorder.prepare();
        recorder.start();


    } catch (IllegalStateException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

but is it possible while I record audio, to display as video one static image e.g app logo?

我录制音频文件如下:

private void startRecording(){
    recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(output_formats[currentFormat]);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    recorder.setOutputFile(getFilename(count_sound));
    recorder.setMaxDuration(30000);
    recorder.setOnErrorListener(errorListener);
    recorder.setOnInfoListener(infoListener);


    try {
        recorder.prepare();
        recorder.start();


    } catch (IllegalStateException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

但是否有可能,而我录制的音频,作为视频显示静态图像如应用程序徽标?

android  android-mediarecorder