ChineseTtsTflite
0.5.0
使用Kotlin + JetPack Compose + Tensorflow Lite開發的TTS引擎,可以完全離線使用。
可選兩種模型:FastSpeech和Tacotron,這兩種模型均來自TensorFlowTTS
文字轉拼音方法來自:TensorflowTTS_chinese
因為是實時推理輸出音頻,故對設備性能有一定要求。
其中FastSpeech速度較快,但生成的音頻擬人效果較差,可以用於普通中端以上手機。
而Tacotron對性能要求較高,雖然總體效果更好,但因為速度很慢,故目前實用價值不大,僅供測試。
├─app/src/main/assets
│ baker_mapper.json
│ fastspeech2_quan.tflite
│ mb_melgan.tflite
│ tacotron2_quan.tflite
./gradlew assembleRelease下載地址
netron
縮減TensorFlow Lite二進製文件大小
裁剪後aar下載
裁剪前後的arr文件大小對比:
TensorFlowTTS
TensorflowTTS_chinese
tensorflow指南
參考tf測試
參考tflite轉換
Google Pico TTS Source
$ git clone https://github.com/TensorSpeech/TensorFlowTTS.git
$ cd TensorFlowTTS
$ pip install .
$ pip install git+https://github.com/repodiac/german_transliterate.git$ cd models-tf
$ python test-h5.py$ python convert-tflite.py