简体   繁体   中英

Is it possible to capture microphone in background?

One company asked me to make a demo version of their software. After couple hours searching I have come to the conclusion their requirements are not maybe possible.

Problem is capturing microphone in background, even the program is not in use or active. Of course it would be asking of the user permission for that, but is that even possible.

Here is one article: https://www.theverge.com/2018/3/7/17091104/android-p-prevents-apps-using-mic-camera-idle-background

I am not special with Android systems, but is this the end of my project?

The purpose is made this demo with Java. It is "easy" to make an app which is listening microphone and comparing this recorder sound with given sound. In bytes. But in background.. Driving me crazy. Have not found any discussion of this kind of mic using. So thats why i am here guys.

https://developer.android.com/guide/topics/media/mediarecorder

Note: On devices running Android 9 (API level 28) or higher, apps running in the background cannot access the microphone. Therefore, your app should record audio only when it's in the foreground or when you include an instance of MediaRecorder in a foreground service.

If i am understand this right, this kind of app not working on any newer Androids?

Thanks.

On devices running Android 9 (API level 28) or higher, apps running in the background cannot access the microphone. Therefore, your app should record audio only when it's in the foreground or when you include an instance of MediaRecorder in a foreground service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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