piper
piper copied to clipboard
trying to get my Piper voice in Android using SherpaOnnx.
Hi! I managed to create a piper voice model of NokiaTTS syntesizer in Spanish. As a fact, is one of the fastest Piper models I got, same for other models like Keynote Gold and the voice of Windows XP Tour. As a consequence, I wanted to try to get them in my Android phone, but there's not a lot of documentation, or simply there's not a very good explanation like it did the person that made the tutorial of training Piper on WSL. As a consequence, I decided to try to decompile a voice (I decided to choose Glados) and I decided to change the voice in assets folder. What exactly I did was put the SherpaOnnx/Piper model with the json, .onnx and tokens file and tried to recompile. But apparently no result. Can someone help a bit in compilation step? BTW I suggest that there will be some day an app that allows you to load several piper voices in Android and choose between them. Is a nightmare compiling an app for just one model, and if you install other model the previous model is uninstalled. Here is actually the apk of Glados voice I used for modification. https://www.mediafire.com/file/unxjpgs12qr4tlf/sherpa-onnx-1.9.3-arm64-v8a-es-tts-vits-piper-es-glados-medium.apk/file Here is actually the piper model with tokens.txt file. https://www.mediafire.com/file/hpqq35rwwtgrpio/es-NokiaTTS-medium.zip/file Here is the modded apk. https://www.mediafire.com/file/xf4fsfzr6yg53ef/piper-es-NokiaTTS-medium.apk/file
Hi, Sherpa onnx has many unnecessary components apart of text-to-speech, which means the response time is too high for screen reader. I remember someone did a prototype project to implement pure piper for Android what worked fast on Talkback, but the work seems to be paused.
Cheers.
Nice to know that. Would be fun to test that pure piper implementation with some voices. At least, I thought that using these retro tts models with piper it would have a bit less latency! Cheers.
Maybe you whant to look at this ? https://github.com/jing332/SherpaOnnxTtsEngineAndroid
Sherpa onnx has many unnecessary components apart of text-to-speech, which means the response time is too high for screen reader.
@rmcpantoja
Could you be more specific about the response time?
sherpa-onnx supports many functions apart from TTS. However, if you don't use the other functions at runtime, then your response time won't be affected. You don't pay for what you don't need.
As a consequence, I decided to try to decompile a voice (I decided to choose Glados) and I decided to change the voice in assets folder. What exactly I did was put the SherpaOnnx/Piper model with the json, .onnx and tokens file and tried to recompile. But apparently no result.
@Sergiaws
You need to follow the following doc
https://k2-fsa.github.io/sherpa/onnx/tts/piper.html#add-meta-data-to-the-onnx-model
to add metadata to your .onnx model and then it can be used in sherpa-onnx.
If you have any further issues, i suggest that you create a ticket in sherpa-onnx's repo.
@csukuangfj, I am trying the same thing here and feeling a bit lost on the documentation and tutorials of sherpa-onnx. (This comes from a very dumb developer, so forgive me if my struggles are too obvious 😅)
I would love to see a tutorial that teaches me how to port my Piper-trained model to sherpa-onnx on Android. If I got it right from the docs, the steps would be like:
- Port the piper model to sherpa-onnx on Python, following this doc.
- Use this doc to build an APK for my particular use-case.
In my case, I would be using the Engine tutorial, so I need to build with SherpaOnnxTtsEngine. Also, I have to make it a library in my application instead of a standalone APK to import it all instead of having to install the APK.
Does it make any sense for you, @csukuangfj? If positive, I would love to make that contribution to the docs of sherpa-onnx.
PS: Maybe this message could have been posted on https://github.com/k2-fsa/sherpa-onnx discussion sections, but I kept it here for context.
@csukuangfj, I am trying the same thing here and feeling a bit lost on the documentation and tutorials of sherpa-onnx. (This comes from a very dumb developer, so forgive me if my struggles are too obvious 😅)
I would love to see a tutorial that teaches me how to port my Piper-trained model to sherpa-onnx on Android. If I got it right from the docs, the steps would be like:
- Port the piper model to sherpa-onnx on Python, following this doc.
- Use this doc to build an APK for my particular use-case.
In my case, I would be using the Engine tutorial, so I need to build with SherpaOnnxTtsEngine. Also, I have to make it a library in my application instead of a standalone APK to import it all instead of having to install the APK.
Does it make any sense for you, @csukuangfj? If positive, I would love to make that contribution to the docs of sherpa-onnx.
PS: Maybe this message could have been posted on https://github.com/k2-fsa/sherpa-onnx discussion sections, but I kept it here for context.
Yes, your steps are correct. Looking forward to your contribution.