Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build sherpa-ncnn for Android ( C++ ) #307

Open
HassanTen opened this issue Feb 18, 2024 · 31 comments
Open

Build sherpa-ncnn for Android ( C++ ) #307

HassanTen opened this issue Feb 18, 2024 · 31 comments

Comments

@HassanTen
Copy link

How is this step applied in detail?
Build sherpa-ncnn (C++ code)
Link
https://k2-fsa.github.io/sherpa/ncnn/android/build-sherpa-ncnn.html

@csukuangfj
Copy link
Collaborator

We have described it in detail in the doc.

Could you tell us which step you are not clear about?

@HassanTen
Copy link
Author

HassanTen commented Feb 19, 2024

We have described it in detail in the doc.

Could you tell us which step you are not clear about?

I tried all the applications (open source) for at least six months and did not find anything better than this application ( sherpa-ncnn-2.1.7-cpu-arm64-v8a-en )

I posted your project to everyone on Facebook, but I did not find a solution to this proble.

it is time to build the C++ code of sherpa-ncnn.

Is there a video of this application?

@csukuangfj
Copy link
Collaborator

Is there a video of this application?

Yes, you can find the link to video(s) at README.md of this repo.


Please describe in detail the issues you have when building sherpa-ncnn.

@HassanTen
Copy link
Author

HassanTen commented Feb 19, 2024

Is there a video of this application?

Yes, you can find the link to video(s) at README.md of this repo.

Please describe in detail the issues you have when building sherpa-ncnn.

I looked at it in the past few days but did not find a video on how to install sherpa-ncnn on Android Studio

If you make this video and put it below the Android project

Or prepare it without steps, as the Vosk api developer did

Although your project gives better results than vosk api
You will find unprecedented demand on your platform

I am a forum. I learned Java and Kotlin and worked on projects on Android Studio. The problem is I do not know C++ which files to choose from your project .

This is why your github is not popular because not all people learn C++ or how to add or convert files.

Thank you for your responses and your efforts

@csukuangfj
Copy link
Collaborator

Is there a video of this application?

Yes, you can find the link to video(s) at README.md of this repo.

Please describe in detail the issues you have when building sherpa-ncnn.

I looked at it in the past few days but did not find a video on how to install sherpa-ncnn on Android Studio

If you make this video and put it below the Android project

Or prepare it without steps, as the Vosk api developer did

Although your project gives better results than vosk api
You will find unprecedented demand on your platform

I am a forum. I learned Java and Kotlin and worked on projects on Android Studio. The problem is I do not know C++ which files to choose from your project .

This is why your github is not popular because not all people learn C++ or how to add or convert files.

Thank you for your responses and your efforts

Have you followed the doc for Android?

You are the first user who doesn't know how to do with it after reading the doc.

If you can be more specific about at which step you have issues and what command you have run, we can fix the doc.

@HassanTen
Copy link
Author

HassanTen commented Feb 22, 2024

I just didn't understand this step
I asked people who didn't know
Build sherpa-ncnn (C+- code)
link
https://k2-fsa.github.io/sherpa/ncnn/android/build-sherpa-ncnn.html
Can you help me use the TeamViewer remote computer control
program?

@csukuangfj
Copy link
Collaborator

Please tell us in detail which step you don't understand and what you have done.

@csukuangfj
Copy link
Collaborator

By the way, we even have a colab in the doc that you can follow step-by-step.

I just don't know which step you don't understand and the issues/errors you have.

@HassanTen
Copy link
Author

Screenshot_٢٠٢٤٠٢٢٠_٢٢١٢١٨_Samsung Internet

How do I use it on Windows 11 (64x)

@HassanTen
Copy link
Author

HassanTen commented Feb 22, 2024

The previous steps layer on Android Studio but I stopped here

@csukuangfj
Copy link
Collaborator

Please continue reading.

Screenshot 2024-02-22 at 11 03 15

@HassanTen
Copy link
Author

I put it on the command prompt and nothing happened

@csukuangfj
Copy link
Collaborator

I put it on the command prompt and nothing happened

Please post a screenshot about what you have run.

@HassanTen
Copy link
Author

٢٠٢٤٠٢٢٢_٠٥١٥٢٥

@csukuangfj
Copy link
Collaborator

Screenshot 2024-02-22 at 11 18 28

We have mentioned it explicitly. The scripts are for linux and macOS.

But you are using Windows. Please follow the instruction in the doc if you are using windows.

You can download pre-built libraries from us and there is no need for you to build them again.

@HassanTen
Copy link
Author

٢٠٢٤٠٢٢٢_٠٥٢٣٤٤

Which file should I choose?

@csukuangfj
Copy link
Collaborator

You can download an APK, unzip it, and you will find .so inside.

There are APKs for different ABIs; you need to choose the correct one depending on which ABI you want to use.

For instance, if you want to run it on your phone, you would probably select an APK that contains arm64-v8a in its name.

If you want to run with your emulator on Android Studio and your emulator uses x86_64, then you need to select
an APK that contains x86_64 in its name.

@HassanTen
Copy link
Author

The microphone works but does not convert speech into text

@csukuangfj
Copy link
Collaborator

Which model are you using and what changes have you made?

Does pre-built APK work for you?

@HassanTen
Copy link
Author

sherpa-ncnn-2.1.7-cpu-arm64-v8a-en.apk on github (done)
But
My app ( does not work )

@csukuangfj
Copy link
Collaborator

Which model are you using?

@HassanTen
Copy link
Author

HassanTen commented Feb 22, 2024

sherpa-ncnn-conv-emformer-transducer-2022-12-06

https://huggingface.co/csukuangfj/sherpa-ncnn-conv-emformer-transducer-2022-12-06/tree/main

@csukuangfj
Copy link
Collaborator

Do you speak Chinese if you use this model?

@csukuangfj
Copy link
Collaborator

csukuangfj commented Feb 22, 2024

Give me English model

Please read our doc. You can find lots of models in the doc.

@csukuangfj
Copy link
Collaborator

By the way, you can also find the models after unzipping the APK .

@HassanTen
Copy link
Author

HassanTen commented Feb 24, 2024

Why is Model 2022 faster than Model 2023?
I want to create a Model?
What are the steps or site that helps me with this?
Can I choose specific words that he will search for (grammar) ?

@csukuangfj
Copy link
Collaborator

csukuangfj commented Feb 25, 2024

Could you describe what is Model 2022 and Model 2023. It is not clear what you are referring to.

Also, what is Moodle?

@HassanTen
Copy link
Author

Why is Model sherpa-ncnn-conv-emformer-transducer-2022-12-06 faster than Model sherpa-ncnn-streaming-zipformer-en--2023-02-13?

How can I create my own model?

Can I choose specific words that he will search for (grammar) ?

@csukuangfj
Copy link
Collaborator

Why is Model sherpa-ncnn-conv-emformer-transducer-2022-12-06 faster than Model sherpa-ncnn-streaming-zipformer-en--2023-02-13?

Could you give us numbers (e.g., RTF) about how faster is sherpa-ncnn-conv-emformer-transducer-2022-12-06?

@csukuangfj
Copy link
Collaborator

Can I choose specific words that he will search for (grammar) ?

We support only greedy_search and modified_beam_search in sherpa-ncnn. The two methods don't support grammar decoding.

@HassanTen
Copy link
Author

Why is Model sherpa-ncnn-conv-emformer-transducer-2022-12-06 faster than Model sherpa-ncnn-streaming-zipformer-en--2023-02-13?

Could you give us numbers (e.g., RTF) about how faster is sherpa-ncnn-conv-emformer-transducer-2022-12-06?

Measuring Time and Retrieving a Result

import kotlin.time.measureTimedValue

val (result, duration) = measureTimedValue {
// ... your code block that produces a result ...
}
println("Result: $result, took: $duration")

link
https://josiassena.com/mastering-time-with-kotlin-inside-the-new-timing-api/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants