k2-fsa / sherpa-ncnn

Real-time speech recognition using next-gen Kaldi with ncnn without Internet connection. Support iOS, Android, Raspberry Pi, VisionFive2, LicheePi4A etc.
https://k2-fsa.github.io/sherpa/ncnn/index.html
Apache License 2.0
891 stars 138 forks source link

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

Open HassanTen opened 4 months ago

HassanTen commented 4 months ago

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 commented 4 months ago

We have described it in detail in the doc.

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

HassanTen commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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

csukuangfj commented 4 months ago

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 commented 4 months ago

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

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

HassanTen commented 4 months ago

The previous steps layer on Android Studio but I stopped here

csukuangfj commented 4 months ago

Please continue reading.

Screenshot 2024-02-22 at 11 03 15

HassanTen commented 4 months ago

I put it on the command prompt and nothing happened

csukuangfj commented 4 months ago

I put it on the command prompt and nothing happened

Please post a screenshot about what you have run.

HassanTen commented 4 months ago

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

csukuangfj commented 4 months ago

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 commented 4 months ago

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

Which file should I choose?

csukuangfj commented 4 months ago

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 commented 4 months ago

The microphone works but does not convert speech into text

csukuangfj commented 4 months ago

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

Does pre-built APK work for you?

HassanTen commented 4 months ago

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

csukuangfj commented 4 months ago

Which model are you using?

HassanTen commented 4 months ago

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

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

csukuangfj commented 4 months ago

Do you speak Chinese if you use this model?

csukuangfj commented 4 months ago

Give me English model

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

csukuangfj commented 4 months ago

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

HassanTen commented 4 months ago

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 commented 4 months ago

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

Also, what is Moodle?

HassanTen commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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/