-1

i have a big problem. I am working on an app about accessibility. The app should work through the iPhone microphone to take over sounds from the environment (indoor) and compare them in real time with sounds in the app database (recorded from users previously). If sounds match, the user will be warned by the app through a notification. So... firstly, the app should listen sounds working in background, but after some minutes, iOS closes the app in background automatically. IS THERE SOME SOLUTIONS FOR THIS PROBLEM? TO ALLOW THE APP BE OPENED AND WORKING? Secondly, do you know in which way is possible compare sounds recorded with sounds listened by microphone in real time? Really really thank you.

2 Answers2

1

Regarding the problem that your app is automatically closed, it seems that something was not configured properly in your project.

When the UIBackgroundModes key contains the audio value, the system’s media frameworks automatically prevent the corresponding app from being suspended when it moves to the background.

Make sure that you have enabled the "Audio, AirPlay and Picture in Picture" background mode in your project.

Enrique Bermúdez
  • 1,740
  • 2
  • 11
  • 25
1

Fore the first question: Because your app will be recording the audio while in background, you can:

And be careful with this, you might have to deal with Apple Review team to prove that your app is not doing something harm to user privacy. Otherwise, they wouldn't let it go live.

For the second question: I think you can use some AI/Machine Learning service out there to do so. It's much more accurate and faster than building it your own.

Ryan Ho
  • 293
  • 1
  • 3
  • 14