Hey there, earlier on I've had my troubles with the microphone plugin on Android, but eventually I got it in a stable working order (without me really knowing what was wrong before). Now, when it's time for an update the microphone part in my project appears non-functional again.
I've "rolled back" to the Microphone plugin example project, and it behaves the same.
I can press Record, press Record Stop, but when I press Play it's playing back a zero seconds long sound file, since the button immediately returns to an 'up' state. Obviously the app creates a sound file, because initially Play button is disabled, but once something is "recorded" the Play button is enabled. Also, getLength() on sound returns 0 (zero).
I get no errors, no crashes. I have no idea how to debug this further.
This applies only on Android devices. On PC (Gideros player) and iOS it works like as expected.
Tried direct apk export (from 2017.3.1) as well as export via Android Studio, same behavior.
Exporting using Android SDK Version 25 and Tools 25.0.1, Java JDK 1.8.0_121.
Clues, anyone?
Comments
minSdkVersion 9
targetSdkVersion 19
The devices I'm testing on is API 22 and 25. The mic in an old version of the app is working fine on the 22, I just don't dare to update it...
Edit: Oh, I *have* updated it, but only from Android Studio (new icon), from where it works, not from a new Gideros Studio export.
If you mean which compiling API level it's 25 with tools 25.0.1, Android Studio won't settle with lower tools version than 25.0.0. I am pretty sure the microphone previously has been in working order under at least API 22.
But even if it is an issue with permissions (or anything else), is there a competent angel out there that is able to fix what has become broken? :o3
https://developer.android.com/guide/topics/permissions/requesting.html#normal-dangerous
So if you target SDK23, record_audio permission won't be granted to the plugin since it doesn't explictly request it. If you continue to target a lower version, then old permission checking is applied and it should work as before.
Likes: saeys
So, apart from establishing the fact that the gideros mic plugin probably isn't working when targeting newer Android versions, I'm back at square one. :-(
More clues, anyone?
Likes: saeys
In your GMicrophone.java, change sActive initial value from false to true (line 13):
Likes: saeys
I have no idea what sActive does, but I see that an old gideros export (I think 2016.8.2) with sActive = false renders a functional microphone, but the same project re-exported with 2017.3.1 does not. And the Activity.java doesn't look the same...
Anyway I hope that setting it to true from the beginning of the class doesn't brake something else later on. X_X
Doesn't the plugin need to be updated somewhere then (also to fit newer APIs/permissions)? I'm afraid I'm not very familiar with GitHub.
Likes: saeys