Cannot build with the SoundAnalysis extension

testpitch
testpitch.aia (506.8 KB)

My app using the SoundAnalysis extension works fine when I use the Companion to run it, but when I build it and try to run on the phone, it gives me a runtime error, startRecording() called on an unitialized AudioRecord.

I have attached a simple program that gives me this error, hope you can reproduce it, and make suggestions. I am running Android 7.
warmly,
Arun

Try with

Screen1.Initialize
AskForPermission: android.permission.RECORD_AUDIO

Here other extension
http://kio4.com/appinventor/239C_extensiones_nivel_microfono.htm

Thank you, Juan Antonio! It worked. I owe you one
warmly
arun

the problem now is, that the first time I run the app, it asks for permission to record audio, and even though I grant it, it crashes, with the error mentioned above. When I run the app again, it runs fine. Is there a way to fix this? Or is there some other pitch detection extension I could use?
warmly,,
Arun

Ask the user to restart the app once permissions are granted ?

Strange, but yes, try this:

grafik

Terrific! It worked! Hugs to Anke and all the helpful people in this group.
warmly
arun

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.