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

How can I use my own models on Android? #706

Open
elnursamedzade opened this issue Mar 26, 2024 · 14 comments
Open

How can I use my own models on Android? #706

elnursamedzade opened this issue Mar 26, 2024 · 14 comments

Comments

@elnursamedzade
Copy link

Hello.
I have TTS models that I trained with Piper. How can I use this as a TTS engine?

I placed my own TTS model in the android/SherpaOnnxTtsEngine/app/src/main/assets directory, I copied the previously created library files to the jniLibs/arm64-v8a directory.
When I run the APK on the phone, the application crashes. What could be the problem?

@carapatounfor
Copy link

it could be lots of things, if you post the log with the errors it will be easier to say. take a look on this issue i opened an solved yesterday: #701

@csukuangfj
Copy link
Collaborator

it could be lots of things, if you post the log with the errors it will be easier to say. take a look on this issue i opened an solved yesterday: #701

Yes, you are right.

Please give us error logs. Otherwise, we don't know what bad things have happened.

@elnursamedzade
Copy link
Author

elnursamedzade commented Mar 27, 2024 via email

@csukuangfj
Copy link
Collaborator

please use logcat to get the logs.

@csukuangfj
Copy link
Collaborator

Please download any piper model provided by us, unzip it, and you will find the code for adding meta data and for generating tokens.txt

@elnursamedzade
Copy link
Author

I implemented it exactly and got the following error in the python code:

ImportError: cannot import name 'Lang' from 'iso639' (unknown location)

@csukuangfj
Copy link
Collaborator

Please see

# pip install iso639-lang
from iso639 import Lang

@csukuangfj
Copy link
Collaborator

By the way, we have a dedicated page describing how to convert piper models to sherpa-onnx.

Please see
https://k2-fsa.github.io/sherpa/onnx/tts/piper.html

@csukuangfj
Copy link
Collaborator

If you know the language code, you don't need to use iso639.

@elnursamedzade
Copy link
Author

Problem solved. Thank you. This issue can now be closed. The generated apk sometimes becomes unresponsive and the double-talk errors mentioned in #701 persist. This error is also present in apks in your repository. For example sherpa_onnx_1_9_12_arm64_v8a_tr_tts_engine_vits_piper_tr_TR_fahrettin.apk,. Maybe a new issue can be opened for this.

@csukuangfj
Copy link
Collaborator

The generated apk sometimes becomes unresponsive and the double-talk errors mentioned in #701 persist

Could you describe what phone you are using? What type of CPU does your phone have?

Also, would you mind providing a video to show the issue?

I have never encountered such an issue before.

@elnursamedzade
Copy link
Author

Since I am visually impaired, taking video may be a problem. The phone I use is Unihertz Titan Slim.

I also have a Blackberry Keyone device. I will try it on that device and write the result here.

@csukuangfj
Copy link
Collaborator

The phone I use is Unihertz Titan Slim.

This phone has 4 Cortex A73 CPUs and 4 Cortex A53 CPUs.
I don't know which 2 CPUs are used for the TTS engine. The TTS engine uses 2 threads by default.

If it uses A73, then there shouldn't be any issues.

@elnursamedzade
Copy link
Author

I can not understand. The apk I created works with the interface on the device, that is, when I write something in the text box and test it, it speaks, but it does not work with talkback or other screen readers, it remains silent.

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

3 participants