tchvu3 / capacitor-voice-recorder

Capacitor plugin for voice recording
69 stars 57 forks source link

Android canDeviceVoiceRecord gives false negative #10

Closed pbackup12345 closed 2 years ago

pbackup12345 commented 2 years ago

Checking out the Android version canDeviceVoiceRecord function it gives false while I can still record. Looking at the code itself, I don't fully understand how it works. As I can see it tries to create a MediaRecorder and then tries to start and stop it. However if I run this before asking for permission it will always fail. So basically I don't see the purpose of the function, and in its current position (before asking for permission) it took me a lot of time to realize that I should simply not use this for right now.

tchvu3 commented 2 years ago

thanks, I will check it and release a fix

tchvu3 commented 2 years ago

I fixed the problem, actually I made sure to always return true as to not break any project dependent on this plugin. There is no real reason to check this as any phone will have microphone