benjaminwan / chinesettstflite Goto Github PK
View Code? Open in Web Editor NEWAndroid Chinese TTS Engine Base On Tensorflow TTS , use for TfLite Models Test。安卓离线中文TTS引擎,在TensorflowTTS基础上开发,用于TfLite模型测试。
License: Apache License 2.0
Android Chinese TTS Engine Base On Tensorflow TTS , use for TfLite Models Test。安卓离线中文TTS引擎,在TensorflowTTS基础上开发,用于TfLite模型测试。
License: Apache License 2.0
2022-12-30 16:20:01.680 10684-10684/com.benjaminwan.chinesettstflite E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.benjaminwan.chinesettstflite, PID: 10684
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.benjaminwan.chinesettstflite/com.benjaminwan.chinesettstflite.ui.MainActivity}: java.lang.IllegalArgumentException: Contents of /data/user/0/com.benjaminwan.chinesettstflite/files/fastspeech2_quan.tflite does not encode a valid TensorFlow Lite model: Mmap of '60' at offset '0' failed with error '22'.
The model allocation is null/empty
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6810)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.lang.IllegalArgumentException: Contents of /data/user/0/com.benjaminwan.chinesettstflite/files/fastspeech2_quan.tflite does not encode a valid TensorFlow Lite model: Mmap of '60' at offset '0' failed with error '22'.
The model allocation is null/empty
at org.tensorflow.lite.NativeInterpreterWrapper.createModel(Native Method)
at org.tensorflow.lite.NativeInterpreterWrapper.(NativeInterpreterWrapper.java:50)
at org.tensorflow.lite.NativeInterpreterWrapperExperimental.(NativeInterpreterWrapperExperimental.java:40)
at org.tensorflow.lite.Interpreter.(Interpreter.java:196)
at com.benjaminwan.chinesettstflite.tts.FastSpeech2.(FastSpeech2.kt:12)
at com.benjaminwan.chinesettstflite.tts.TtsManager.initModels(TtsManager.kt:86)
at com.benjaminwan.chinesettstflite.ui.MainActivity.onCreate(MainActivity.kt:25)
at android.app.Activity.performCreate(Activity.java:7224)
at android.app.Activity.performCreate(Activity.java:7213)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
... 11 more
你好!我想直接使用编译好的so库,不用在gradle里使用implementation,这个如何操作?我按照网上介绍的方法把so对应cpu的文件夹和文件放入到libs,然后在gradle里增加ndk和sourceSets。但运行却出现找不到org.tensorflow.lite.Interpreter类的错误,我也用loadlibrary加载了so,不知道还需要哪些配置?希望得到帮助,谢谢!
I really like this project!
I happen to speak english and would like to try and make a TTS run by Tacotron which runs english.
Would you be able to lead me in the right direction to making a english alternative?
此处转换成PCM_16BIT的方法效率太低了,会导致停顿特别长,可以试试下面的方法。
private byte[] convertTo16Bit(float[] data) {
byte[] byte16bit=new byte[data.length<<1];
for (int i = 0; i < data.length; i++) {
short temp=(short) (32768 * data[i]);
byte16bit[i * 2] = (byte) (temp);
byte16bit[i * 2 + 1] = (byte) (temp >> 8);
}
return byte16bit;
}
在安卓原生TTS里面有一个isSpeaking的布尔值,可以判断播放是否正在进行。正在进行为true,播放结束为false。
编译后无论平台是X86或arm,tensorflow lite都会生成两个so库,而且其中一个大小都挺大,请问有没有什么方法或设置能够把这个大小给降下来?
有时会出现小的轻微咔嚓声, 好像不支持中英文混读。
非常感谢开发,终于有离线的tts了
期待未来加入男声,添加更多语音模型
谢谢
TTS with emotions https://github.com/suno-ai/bark This is very cool.
coqui-ai TTS
Mozilla's Text-to-Speech
请问是否可以将应用发布到 F-Droid?
大神你好,我想请问下项目可以播报比如ABCD这种26个字母的发音吗?
看了我们代码逻辑应该中文转拼音,拼音转英标,最后根据 baker_mapper.txt文件去转换出来的。
我想请问下,字母可以发音吗?
谢谢了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.