在Android应用程序中录制来自外部源的音频 [英] Recording audio from external source in an android application

查看:329
本文介绍了在Android应用程序中录制来自外部源的音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到这里有一个类似的问题: 是否可以在Android中录制视频时从外部麦克风录制声音?

I saw there was a similar question here: Is it possible to record from the external mic when recording video in Android?

但是,这个问题从未得到真正的回答,并且android文档没有明确说明该操作的完成方式.

However, the question was never really answered and android documentation does not clearly state how this is done.

此线程中的此人声明这是可能的,但没有说明如何做到. 从外部麦克风实时捕获和播放音频

This person in this thread states that it is possible, but does not say how. Real-time audio capture and playback from an external mic

在"setAudioSource"部分中进行选择对您来说很有意义,但是这些选项都不是用于外部源的.

It would make sense for you to make the selection in the "setAudioSource" section, but none of the options are for external sources.

MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_DOWNLINK);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

我对我的应用程序完成99%感到困惑.任何帮助将不胜感激.

I am stuck with my app being 99% done. Any help would be greatly appreciated.

推荐答案

在我对USB Audio产品的测试中,如果已连接,MIC,DEFAULT和VOICE_COMMUNICATION信号源都将切换到USB Audio麦克风. CAMCORDER源始终使用内置麦克风.不过,我找不到任何清晰的文档. 此页面根本没有提到外部/USB音频

In my testing of USB Audio products, the MIC, DEFAULT, and VOICE_COMMUNICATION sources all switch to a USB Audio mic if it's connected. The CAMCORDER source always uses the built-in mic. I can't find any clear documentation of this, though. This page doesn't mention external/USB audio at all.

这篇关于在Android应用程序中录制来自外部源的音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆