Coder Social home page Coder Social logo

chinesetts's Introduction

TTSChinese

Build GitHub Colab

这是一个TensorFlowTTS中文语音合成的Android demo工程。项目基于TensorFlowTTS的Android example。在此基础上做了些修改,并且针对数字的播报做了简单的转换和处理。

相关参考

  • 生成tflite文件,具体可参考此colab进行。在转换成tflite时建议大家安装最新版本的tensorflow,否则可能会导致转换后的模型在安卓手机上跑时会出现杂音的情况。
  • 修改原demo项目中的部分代码参数,具体可参考博客TensorflowTTS 中文android客户端。最关键的中文text2ids的Processor博客中没有给出,根据参考baker_mapper.json自己写了一个,汉字转拼音用的是pinyin4j的工具库,然后对照着colab上的结果进行拼接,后续计划继续完善转换播报的规则代码,例如2021/02/07的格式转换成日期的播报方式,也希望大家可以一起补充完善。

使用

添加依赖

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

  dependencies {
	        dependencies {
            	       implementation 'com.github.jinguangyang:ChineseTTS:1.0.0'
            	}
}

初始化

 TtsManager.getInstance().init(this);

        TtsStateDispatcher.getInstance().addListener(new OnTtsStateListener() {
            @Override
            public void onTtsReady() {
                speakBtn.setEnabled(true);
            }

            @Override
            public void onTtsStart(String text) {
            }

            @Override
            public void onTtsStop() {
            }
        });

开始语音

  TtsManager.getInstance().speak(inputText, speed, true);

结束语音

    TtsManager.getInstance().stopTts());

目前不支持按时间格式进行播报,有兴趣的大神可以完善

chinesetts's People

Contributors

jinguangyang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.