Git Product home page Git Product logo

xftts-dart's Introduction

xftts

Xun Fei TTS dart implementation based on: https://www.xfyun.cn/doc/tts/online_tts/API.html.

Usage

A simple usage example:

import 'package:xftts/xftts.dart';

main() async {
  // retrieve appId/apiKey/apiSecret
  final env = Platform.environment;
  final app = env["APP"] ?? '1';
  final appId = env['XF_TTS_ID$app'];
  final apiKey = env['XF_TTS_KEY$app'];
  final apiSecret = env['XF_TTS_SECRET$app'];
  
  // initiate the class
  final tts = TTS(appId, apiKey, apiSecret);

  // generate mp3
  text = '''
  君不见黄河之水天上来,奔流到海不复回。
 君不见高堂明镜悲白发,朝如青丝暮成雪。
 人生得意须尽欢,莫使金樽空对月。
 天生我材必有用,千金散尽还复来。
  '''

  await tts.generateMp3ForText(text, '/tmp/test.mp3');
}

xftts-dart's People

Contributors

tyrchen avatar

Stargazers

Joey Huang avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

copyup

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.