I am trying to get audio input through the headphone jack for my final year project. It would be a great help if someone can share some code on how to capture the data. I have been trying but as I am fairly new to android, I couldn't find any API for headphone jack in MediaRecorder.AudioSource... There are only these sources available: http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html
相关问题
- How can I create this custom Bottom Navigation on
- Can we recover audio from MFCC coefficients?
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Is there a way to play audio on a mobile browser w
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
If you choose e.g.
DEFAULT
orMIC
fromMediaRecorder.AudioSource
as the input then a TRRS plug attached to your phone will automatically be used as the input instead of the internal microphone.But you have two keep three things in mind:
1) Number of channels
The TRRS plug has two lines for left and right channel of the headphone but only one line for the external microphone (see e.g. this description of the plug). So you can only do monophonic recordings (the only smartphone exception at the moment: the Sony Z2 has a new TRRRS plug). You can build an adapter on your own (see e.g. the pictures here).
2) Level
You can't connect the line-out of e.g. a CD player directly to the input. You need to use e.g. a resistive voltage divider to reduce the output level to avoid overload.
3) Signal manipulation
Typically, there is smartphone-manufacturer-dependent fancy signal processing in the firmware like automatic gain control (AGC) and/or equalization, noise suppression, echo cancellation. You can't switch it off, so you don't get a perfect copy of your input signal.