Hi all,
I'm kinda lost trying to iron out what's not working with the microphone plugin in my project.
The same behavior occurs on the microphone example project. It runs well in the windows Gideros player as well as when exported to an Android device via Android Studio. It SEEMS to record something (stop button replaces the record button), but when the play button is pressed it seems to playback an empty file, because the play button changes to 'stop' in an instance before changing back to 'play'. This happens in the exported app on an device.
No app crashes and no errors in the logcat. I think the plugin files are in place as well as the lines in the manifest and activity file. The thing is that the exact same project worked with no errors in previous exports before, but now all I can get is the above described behavior. Something must have changed in my environment, but I can't really figure out what it could be. Suggestions anyone?
Comments
It is as if the output file
Anyone?
I can't find record.wav anywhere, especially not in sdcard root. Evidently, the app knows where it is, otherwise I guess the app would crash when it doesn't find what it's looking for, right?
I put an empty record.wav in /sdcard/, no change.
Does the |D| (or |T|) point to the sdcard root? Or to the app folder, which I also cannot find anywhere.
As far as I know |D| |R| |T| point to the app folder, which I don't know how to locate on the device (on windows is somewhere inside AppData/Local...).
I can tell you that using lfs module I can access /sdcard/ on android and C:\ on laptop: still keeping me in the wild guess side maybe you need to require lfs to use /sdcard/, but there is still the possibility that microphone plugin can't write to it.. %%-
So if I want to be able to save a file on /sdcard/ i need the LFS module? I replaced the |D| with /sdcard/ in both setOutputFile() and sound.new(), same results. (No crash, just no recorded audio to play.)
@pie, maybe your suggestion required the LFS module... Digging some on how to install that it seems a bit over my head just to test a workaround. :-< Especially as it worked well a couple of days ago, and I I'm having a hard time understanding what has happened to the code that could have affected the microphone behavior, specifically. I've reverted back to the microphone example and did the plugin installation from scratch (several times), same results.
Thanks anyway for the suggestion, @pie. Do you or anyone else have any other ideas?
Did you get it to work? If so, how?
I had some problems putting the right plugin files in the right folder, but evidently got it to work eventually. Are there plugin files that has to go in any other places than mentioned in my final comment? (actually I don't think so, but I'm clutching for straws here... :-?? )
I don't think anything is recorded at all. This is why:
1. The mic example is exported and imported to Android studio.
2. Compiled and run on my sony xperia z5 compact (or tablet z) with no errors.
3. When hitting the record button, the level meter isn't indicating any incoming sound. (as it was before)
4. Thus, when hitting play button there is no sound to play. Maybe it's playing a empty sound file, because it doesn't crash either.
(when running mic example on the gideros player on windows record and playback is working fine)
You were the lucky one who managed to use microphone on Android, I was waiting for the next release to try again
I think the problem is the microphone plugin, not the device's file system. There is no data recorded to put in the .wav that is saved. And I think it has to do with the libmicrophone.so, because there are two "missing JNI functions" at the end of GMicrophone.java. (onDataAvailableByte() and onDataAvailableShort() ). But that is as far as my skills goes...
Help, anyone? :-<
I cracked my nuckles, did an gideros export from scratch, copied the necessary mic plugin into the project, did some Android Studio updates, imported the project there, did the usual java and manifest modifications for the plugin, test run... And the microphone's in working order! >:D<
I still have no idea why it wasn't working before, but it could of course have been the Android Studio updates. Still, the onDataAvailableByte() and onDataAvailableShort() mentioned before in GMicrophone.java is marked red ('Missing JNI functions'). I wonder if that will cause the same (or new) problems ahead...
Are there any plans on microphone plugin updates, or, for that matter, an integrated plugin feature in gideros in the future?
and on preliminery run, did not see any issues, and functions are defined as always:
https://github.com/gideros/gideros/blob/master/plugins/microphone/source/Android/jni/gmicrophone-android.cpp#L319-L334
Maybe the 'missing JNI functions' thing is an Android Studio issue. I haven't tried eclipse.
Likes: antix