Comments (15)
That seems to be the expected behavior as shared objects are exporting functions with JNI signature. Does that make sense?
from porcupine.
Maybe... but why do not expose C functions directly, as you do in Windows, Linux, raspberry, etc.?
You can do both things, as many android libraries do, like opencv for example.
from porcupine.
This is just how Android build system works by default. We didn't get any request for alternatives. What is your use case?
from porcupine.
I'm working on a project in which there is an Android application with a native part in a shared library. It's an embedded system and we need maximum performance. We want to integrate a voice command, but, by the way code is organized, audio and video parts are developed in C/C++. On the other hand, I think that it's more efficient to directly access the C API than to use the JNI interface, in this case.
from porcupine.
OK. Yeah, you might get some extra efficiency there. But it is minimal in this case as processing is done all in C and moving audio data around is fairly lite compared to image/video due to much smaller size.
I made a task to look into if we can expose extra functions in the shared object for v1.5 release. That would be the preferred solution.
In the meantime, the library is accessible from Java through JNI.
from porcupine.
Thank you.
For now, can you send me a compiled version to try? I'll confirm if it works.
from porcupine.
We have a task for it in our queue. I will update you when we start working on it.
from porcupine.
+1 to this request - I have been struggling to get Porcupine working in Unity for Android, as it expects developers to be using Java. Unity uses Mono (C#) or IL2CPP (C++) frameworks, which experience segmentation faults whenever I try to call the init function. It would be much more straightforward to interact directly with the Porcupine library.
from porcupine.
@rtumelty why not build against the shared object for Linux/Mac/Windows?
from porcupine.
I am building for Android devices with ARMv7 and ARM64 architectures. x86/64 libraries won't work for the platform.
from porcupine.
I notice that v1.5 is already out. Is this issue solved with that release?
from porcupine.
We didn't get to this feature. But we will be working on it. It is being tracked here as well #115. There are few candidate solutions and we are in the decision-making process.
from porcupine.
In fact, I don't understand why this issue occurs and why it's so difficult to fix it out.
The library is written in C, so the C API functions are there anyway. How is it possible to "hide" them? I include the .h header, so my code just compiles. Then the linker should find the functions there in the library, because the functions are there for sure, aren't they? That's very strange.
What I asked you by mail, since I actually work for a company that has bought or will buy a license, is that, in the meantime, simply take the source code you used for, say, the Linux library, and build it using NDK. I think that would be enough as a temporary solution for us. We don't need the JNI API, if the C API just works.
Thank you.
from porcupine.
The Android binding is designed to be used via a Java interface and using the lib from C is not supported currently. There are use cases that would benefit from using the lib on Android directly from C. This is NOT supported yet. I do appreciate your input. But it is a decision on the Picovoice side if we want to support it when to prioritize it, and how to get it done.
from porcupine.
we decided that we won't offer static libs for android. our offering for Android will be limited to shared objects and JNI interface.
from porcupine.
Related Issues (20)
- Porcupine Issue: Provided model (.pv) file belongs to a different version of the library HOT 1
- Not able to download my ppn model from the website HOT 2
- Picovoice Console Issue: HOT 1
- Porcupine Issue: Its Taking the audio from Device Speaker HOT 1
- Porcupine Issue: PICOVOICE_STATUS_TO_EXCEPTION 00000136 HOT 5
- Picovoice Documentation Issue (/docs/quick-start/porcupine-jetson/) HOT 1
- RK3588 (0xd05) is 100% working HOT 3
- PORCUPINE CASUING ERRORS AND NOT RUNNING TRAINED KEYWORD HOT 1
- Porcupine Documentation Issue: HOT 1
- Porcupine Issue: Japanese model params file is actually for English HOT 1
- Porcupine Issue: Are there any plans to support WebGL on the Unity platform HOT 1
- Porcupine Issue: aauthentication issue HOT 2
- Creating a custom wake word in porcupine HOT 2
- Porcupine Documentation Issue: HOT 3
- Porcupine Issue: ios . HOT 1
- Android x86_64 Support HOT 2
- Picovoice Console Issue: Wake word is not working HOT 1
- Passing in multiple wake word files on iOS only listens for the first wake word passed in HOT 3
- Porcupine Issue: Have an issues after changing .ppn file to a new one. HOT 7
- Picovoice Console Issue: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from porcupine.