I want to check the noise level using the android mic. However before accessing the mic I want to know if the mic is being accessed by another application. How do I check if the mic is being accessed by another application?
相关问题
- 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
Information about active input streams and where they are routed is held by the
AudioFlinger
,AudioPolicyManager
andAudioHardware
instances, which do not share this information with applications.The AudioManager class provides an
isMicrophoneMute()
method to applications, but the mic may very well be unmuted while it's unused, so that method doesn't really tell you anything about whether the mic currently is being used or not.One possible way to find out if there are any input streams routed to the microphone is to do a dumpsys on
media.audio_policy
andmedia.audio_flinger
and parse the output. But the risk is that the output will look different on different devices, plus I don't know if you're allowed to dump the status of those services on a non-rooted device.I think Michael is right but we can't use dumpsys on Android 2.3 and further for some of the services