yse-soundengine icon indicating copy to clipboard operation
yse-soundengine copied to clipboard

re: Android file path storage for assets--

Open zeukterialpneumaion opened this issue 7 years ago • 4 comments

Awesome library ...thankyou!

am prototyping some realtime synthesis for my android app at the moment ... am using android studio and kotlin ... however, it would be very useful to have access to files ... want to do some dsp on incoming microphone streams and some loop sampling ... ...have you seen this thread? https://stackoverflow.com/questions/6346889/how-to-reference-an-asset-in-a-library-project and this:: https://github.com/donkirkby/webandnative/blob/assets/android/.project#L33

zeukterialpneumaion avatar Feb 24 '18 15:02 zeukterialpneumaion

I agree, but it's not that simple. It's one of the reasons why JUCE needs its java hooks. I'm sure I'll look into this sooner or later, but I cannot work full-time on this library and this functionality not a number one priority for me.

If you need to load small files you should look at the BufferIO class. (There is also a demo about it somewhere.) With this class you can pass raw memory buffers (which can be loaded from disk in your java application) to the engine.

It is not very efficient because this means copying the entire buffer when passing it to the native side, but I see this as a temporary solution, workable for small files.

yvanvds avatar Feb 25 '18 09:02 yvanvds

Have you had a look at the native asset manager? https://developer.android.com/ndk/reference/group___asset.html

sonicdebris avatar Apr 19 '18 09:04 sonicdebris

Yes, but it would be a partial solution only. You still have to pass the jnienv variable from the java side to get it to work. That's fine for some applications, but it won't work with Xamarin, for example.

On the other hand, a partial solution might still be an improvement. I'll think about it.

Right now I am working on a build system for android studio. It might be a good alternative if you don't use Visual Studio and help you to implement an asset manager. It's mostly ready, but there are some quirks i have to sort out before I push to github.

yvanvds avatar Apr 19 '18 09:04 yvanvds

An alternative could be using zlib to extract the files from the apk (which is just a zip file after all). Zlib is available in the ndk, but you still have to retrieve the apk path somehow.

sonicdebris avatar Apr 20 '18 02:04 sonicdebris