TaifunFile extension issue (?)

252 views
Skip to first unread message

péter vékony

unread,
Mar 27, 2019, 5:16:44 AM3/27/19
to MIT App Inventor Forum
Hi !

I'm trying to make an app , where the user can make files ( audio recordings ) ; first the app discovers
the directories to let the user choose a place to seve those files.
So , it is done by TaifunFiles AvailableStorageDirectories method , but I get an error message
"BAD ARGIMENTS TO ENABLED : The operation Enabled cannot accept the arguments [*empty-string*]"
Help me , please , how can I fix this - or use this method the proper way ?

Peter

TimAI2

unread,
Mar 27, 2019, 7:41:00 AM3/27/19
to MIT App Inventor Forum
Well this seems to work, but is only returning "/storage/emulated/0" on my Genymotion emulator

blockstfasdirs.png


BodyMindPower

unread,
Mar 27, 2019, 8:33:04 AM3/27/19
to MIT App Inventor Forum
Hi Tim, this is correct. /storage/emulated/0 is the directory of the non-app-specific (private) external storage.
See here for an excellent overview on this topic: https://www.dev2qa.com/android-read-write-external-storage-file-example/
To write / read to / from this directory you need WRITE / READ external storage permissions.

But the new version of Taifun's File extension also supports saving to an app-specific directory which does not require any permissions.

Anke

BodyMindPower

unread,
Mar 27, 2019, 10:01:25 AM3/27/19
to MIT App Inventor Forum
... if the device has a MicroSD card you will get also the directory /storage/xxxx-yyyy/

Anke

péter vékony

unread,
Mar 27, 2019, 11:30:38 AM3/27/19
to MIT App Inventor Forum
....the code - absolutely the same as yours - gave me the issue I've sent

BodyMindPower

unread,
Mar 27, 2019, 11:48:21 AM3/27/19
to MIT App Inventor Forum
Did you start a new project or just insert the blocks into an existing project? If so, start a new project only with these blocks and report if the error reappears. Post a screenshot of the error message.

Anke

Taifun

unread,
Mar 27, 2019, 3:17:14 PM3/27/19
to MIT App Inventor Forum
"BAD ARGIMENTS TO ENABLED : The operation Enabled cannot accept the arguments [*empty-string*]"

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 


Message has been deleted
Message has been deleted

péter vékony

unread,
Mar 28, 2019, 4:07:03 AM3/28/19
to mitappinv...@googlegroups.com
First I've got an update of TaifunFile - so , it's started to work in a simple app.
So , making and showing a list of StorageDirectories is OK without any elements and/or blocks in the app.

By the way , I want to use DJango's WavRecorder extension - so , I've added that to that "simple code" - and it
worked too , but the app is built with the extension only , without any functionality of the extension in the app.

Then I started to make my issued project again , opening a NewProject - but with a copy of blocks from the original project.
I think , this should be a really new project , anyway.
...AND the issue is the same: when I want to make the list of StorageDirectories, that warning comes back again:
"Bad arguments to Enabled
The operation Enabled cannot
accept the arguments, [.....] "
...so , imagine the list of AvailableStorageDirectories instead the dots in the message.

These are .aia and .apk files - made after starting as NewProject , so they are not so nice yet, with some functionaéity only.
https://mega.nz/#!JtxByaqb!VXa08IIUAoxL63wewTIWiVYeUgAdjEY4rhuczPDYBIc
https://mega.nz/#!hsxTiSpZ!nXmQlfb4CCDi_fy4s1vOE4ikNcr4S-lodkcEqNmkbIA

Thanks for Your help !

ps.: by the way , I guess , that error warning comes AFTER activating DJWavREcorder extension - I mean , not included
in the project only , but using it by making blocks with functionality of the extension. ...maybe , in the "final" code , the WavRecorder
extension "makes something" , causing an error ,that generates "my warning".... what do You think ?

Chris Ward

unread,
Mar 28, 2019, 7:34:00 AM3/28/19
to MIT App Inventor Forum
Hello péter

In when pot_level .PositionChanged, you set WavRecord.RecordLevel with a decimal - it must be an integer between 0 and 3.

BodyMindPower

unread,
Mar 28, 2019, 11:06:15 AM3/28/19
to MIT App Inventor Forum
Starting a new project does not mean copying the same mistake again and again:


should be:

BodyMindPower

unread,
Mar 28, 2019, 11:27:28 AM3/28/19
to MIT App Inventor Forum
... we might have needed 20 sec to find this mistake if you had only shown us the relevant blocks, as Taifun said.

Anke

péter vékony

unread,
Mar 28, 2019, 12:03:37 PM3/28/19
to MIT App Inventor Forum
pfffffff!!!!!!!!!!!! ........  thanks for those 20 seconds :)

péter vékony

unread,
Mar 28, 2019, 12:21:09 PM3/28/19
to MIT App Inventor Forum
yes, I do - I've tried with a number higher than 3 , and works well ... it must be a simple multiplication in the background ( in the extension ).
so , slider makes +/- 30 dB adjustment
...this all has started after making a terrible recording of singing of birds in the morning's silent - the built-in recorder
has not the ability of adjusting level , also , it makes records in a lossy format
The result was  some digital noise at very low level . Now , the only one problem is the whitenoise of the mic at higher
levels .... is much better than a permanent digital noise :) .

BodyMindPower

unread,
Mar 28, 2019, 1:35:41 PM3/28/19
to MIT App Inventor Forum
Regarding the quality of the on-board sound recorder, I totally agree with you: cruel.
A wav recorder is much better, but of course the internal micro is the bottleneck factor. So you need to use an external mic to get better sound quality with less noise.

Anke

péter vékony

unread,
Mar 28, 2019, 1:59:38 PM3/28/19
to MIT App Inventor Forum
Of corse , the "mobile world" is so poor for this , also , this "project" started as a "30 minutes project" , even to see
the quality I can reach with a random mobile device ( I have an OUKITEL for playing with ).
...because of my ugly mistake , this 30 minutes exceeded - at least by Your 20 seconds :))

The biggest part of the job is done by WavRecorder extension - not me :) - , but after thinking over, I try
to make some automatic limiter/leveller function to prevent full-sclae distortion.

Also , I have a REAL (?) question: how can I make a folder ( for recordings ) in AppInventor ?

BodyMindPower

unread,
Mar 28, 2019, 2:11:31 PM3/28/19
to MIT App Inventor Forum
As mentioned above, with the new version you can even create an app-specific directory and save the recordings there. The big advantage is that you no longer need permissions.
Reply all
Reply to author
Forward
0 new messages