Closed peacememories closed 2 years ago
thanks for bringing this up, I'll have a look later.
I can't seem to find a permission plugin for macOS.
Could it be possible that macOS permissions can be handled through the iOS part and that the problem is something else?
Either way, the error is definitely raised by permission_handler
.
If you can find a way to permit macOS to record audio I'm happy to update this plugin
Phew, I'm actually pretty new to Flutter and macOS development, so I might take a while^^
I guess one way to check is to create a fork that does not try to use permission_handler
when running on macOS and see what happens?
So I loaded mic_stream
from disk and changed the permissionStatus
getter to just return true. This apparently works on macOS 12.1, the microphone activates and I get some samples.
The samples I get are kinda weird, with my bluetooth headset I got very quiet samples, but I could see changes when I screamed at the laptop (it didn't actually seem to use my headset? it's weird). When I disconnected the headset I got stronger samples, but it looked more like white noise.
But all of that does not seem like it's a permission problem. It might be, though, that it just works because Android Studio already has microphone permissions for whatever reason...
thanks for trying it out.
The plugin uses the default microphone on a given system; for phones that usually suffices. Maybe you want to check which device exactly records the samples, e.g., by producing loud noise with all possible mics physically separated. That may also give a hint about the white noise with your headset disconnected.
Regarding Android Studio... well, it might do some weird stuff. Suggestion: uninstall the test app and reinstall it not with AS but with the flutter CLI directly. I think flutter run
should do the magic. Reinstalling ought to clear any permission statūs.
Relatedly, does the error appear every run?
I've integrated and published @superkeka 's fix in version 0.5.4
.
Please update your pubspec.yaml
, run flutter pub upgrade
and verify that it works now.
Hi, thanks for creating this library :)
I'm running into a bit of a problem with this package on macOS. When I try to get the microphone, i get the following error:
Looking into
permission_handler
it seems it does not have support for macOS, so that might be the reason?