简体   繁体   English

Android录音外部插孔

[英]Android audio record external jack

I would like to record the sound of the jack entry of my android phone. 我想记录我的Android手机的插孔入口的声音。 I've been searching about the Audio Capture class in Android, and i've found this: 我一直在寻找Android中的Audio Capture类,并且发现了这一点:

https://developer.android.com/guide/topics/media/audio-capture.html https://developer.android.com/guide/topics/media/audio-capture.html

In the settings of this class, there are many options to choose the rec default mic, as this: 在此类的设置中,有许多选项可以选择录音默认麦克风,如下所示:

Set the audio source using MediaRecorder.setAudioSource(). 使用MediaRecorder.setAudioSource()设置音频源。 You will probably want to use MediaRecorder.AudioSource.MIC. 您可能需要使用MediaRecorder.AudioSource.MIC。

What should I use to get the sound of the jack entry? 我应该使用什么来获得插孔入口的声音? Is there any example? 有什么例子吗?

Thank you! 谢谢!

The API you provided is the correct one. 您提供的API是正确的。

Calling mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC) (assuming the correct initialization of MediaRecorder as described here https://developer.android.com/guide/topics/media/camera.html -> Capturing Videos) will behave like this: 调用mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC)(假定如此处https://developer.android.com/guide/topics/media/camera.html- >捕获视频所述正确地初始化MediaRecorder)将表现如下:

When you launch your app and start recording without any Jacks connected, phone's default microphones will be used. 当您启动应用并在未连接任何插孔的情况下开始录音时,将使用手机的默认麦克风。 As soon as Jack microphone pin has detected a microphone connected, the system will use the Jack mic pin as an audio imput. 一旦Jack麦克风针脚检测到已连接麦克风,系统就会将Jack麦克风针脚用作音频输入。 Hovewer, you need to know that even though the audio record will have two channels, they will be identical, as Jack microphone can only record mono stream. Hovewer,您需要知道,即使音频记录有两个通道,它们也将是相同的,因为Jack麦克风只能记录单声道流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM