How to give mobile phone permissions to Replit?

I’m working on a mobile app that requires the audio permissions (both microphone and speakers) and when I connect the device I get this error:

Exception in thread Thread-2 (client_send):
Traceback (most recent call last):
File "/nix/store/8w6mm5q1n7i7cs1933im5vkbgvjlglfn-python3-3.10.13/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
you are now connected!
self.run()
File "/nix/store/8w6mm5q1n7i7cs1933im5vkbgvjlglfn-python3-3.10.13/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/runner/Mobile-MT/o2e.py", line 91, in client_send
capture_audio("recorded_audio.wav")
File "/home/runner/Mobile-MT/o2e.py", line 38, in capture_audio
input_devices = sd.query_devices(kind='input')
File "/home/runner/Mobile-MT/.pythonlibs/lib/python3.10/site-packages/sounddevice.py", line 569, in query_devices
raise PortAudioError(f'Error querying device {device}')
sounddevice.PortAudioError: Error querying device -1

Any help would be greatly appreciated.

Repls can’t access your phone, since it runs in the replit cloud. You’ll have to find another way to run that program locally (which might not be easy to do)

2 Likes