GitHub | 您所在的位置:网站首页 › ts合成安卓 › GitHub |
Chinese TTS TF Lite
使用Kotlin + JetPack Compose + Tensorflow Lite开发的TTS引擎,可以完全离线使用。 可选两种模型:FastSpeech和Tacotron,这两种模型均来自TensorFlowTTS 文字转拼音方法来自:TensorflowTTS_chinese 因为是实时推理输出音频,故对设备性能有一定要求。 其中FastSpeech速度较快,但生成的音频拟人效果较差,可以用于普通中端以上手机。 而Tacotron对性能要求较高,虽然总体效果更好,但因为速度很慢,故目前实用价值不大,仅供测试。 手动编译说明 Android Studio 2021.2.1 从下面的模型下载地址,下载models-tflite.7z,把如下4个文件解压到对应目录 从下面的aar下载地址,下载裁剪版TensorFlow Lite的aar,把2个aar文件放到app/libs ├─app/src/main/assets │ baker_mapper.json │ fastspeech2_quan.tflite │ mb_melgan.tflite │ tacotron2_quan.tflite 编译 ./gradlew assembleRelease 模型下载下载地址 models-tf.7z : 原始TensorflowTTS模型,一般用于PC端 models-tflite.7z : 转换后的TFLite模型,一般用于移动端 模型查看netron 裁剪TensorFlow Lite缩减TensorFlow Lite二进制文件大小 裁剪后aar下载 裁剪前后的arr文件大小对比: tensorflow-lite-2.8.0.aar: 5.4MB -> 3.7MB (68.5%) tensorflow-lite-select-tf-ops-2.8.0.aar: 109.6MB -> 14.8MB (13.5%) 参考资料TensorFlowTTS TensorflowTTS_chinese tensorflow指南 参考tf测试 参考tflite转换 Google Pico TTS Source 模型测试&转换 转换环境配置 Ubuntu: 20.04 LTS Python: 3.8 $ git clone https://github.com/TensorSpeech/TensorFlowTTS.git $ cd TensorFlowTTS $ pip install . $ pip install git+https://github.com/repodiac/german_transliterate.git 解压models-tf.7z TF模型测试 $ cd models-tf $ python test-h5.py TF模型转TFLite $ python convert-tflite.py APP界面截图 |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |