Android Question How to play the audio files directly from res/raw folder?

drgottjr

Expert
Licensed User
Longtime User
not that @Erel needs my help, but you should do what he says.

this is how you do it:
https://www.b4x.com/android/forum/threads/organizing-dirassets.26789/#post-154946

you can have sub-folders and sub-folders of sub-folders with dirassets. no problem. plus
you can access the files by name. with res/raw, you need the resource id.

per google documentation:
"... if you need access to original file names and file hierarchy, you might consider saving
some resources in the assets/ directory (instead of res/raw/). Files in assets/ aren't given
a resource ID, so you can read them only using AssetManager."
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
#1: I think It is not support for new version android.

#2: But in media player not support this directory.

wrong (#1) and wrong (#2). i can play .mp3 files in dirassets sub-folder on android13. do it your way. good luck.
 
Upvote 0

mehdipass

Active Member
i can play .mp3 files in dirassets sub-folder on android13. do it your way. good luck.
"Add Group" does NOT add a "disk" folder, it just creates a "visual" folder for you to "visually" organize your files into different groups.

I want disk folder.
In dirassets cannot be created disk folder.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…