GithubHelp home page GithubHelp logo

kid-talk's Introduction

语音文字互转接口

科大讯飞语音识别接口文档

https://www.xfyun.cn/doc/tts/online_tts/API.html#%E6%8E%A5%E5%8F%A3%E8%A6%81%E6%B1%82

语音合成(流式版)WebAPI 文档

https://www.xfyun.cn/doc/tts/online_tts/API.html#%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B

语音播放

https://github.com/TooTallNate/node-speaker https://github.com/TooTallNate/node-lame

播放声音

function convertDataURIToBinary(base64) {
  // var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
  // var base64 = dataURI.substring(base64Index);
  var raw = window.atob(base64);
  var rawLength = raw.length;
  var array = new Uint8Array(new ArrayBuffer(rawLength));

  for(i = 0; i < rawLength; i++) {
    array[i] = raw.charCodeAt(i);
  }
  return array;
}

var binary= convertDataURIToBinary(data);

var blob=new Blob([binary], {type : 'audio/ogg'});

var blobUrl = URL.createObjectURL(blob);

var audio = new Audio(blobUrl);

audio.play();

m4a转mp3

ffmpeg -i input.m4a -c:v copy -c:a libmp3lame -q:a 4 output.mp3

ffmpeg -i test.m4a -ac 1 -ar 8000 -f s16le test.pcm

更改采样率

ffmpeg -i test.m4a -ac 1 -ar 16000 -c:v copy -c:a libmp3lame -q:a 4  -y test.mp3

转PCM

ffmpeg -y  -i test2.webm  -acodec pcm_s16le -f s16le -ac 1 -ar 16000 test2.pcm
ffprobe -show_streams -show_format test2.pcm

ffmpeg -i test2.webm -ac 1 -ar 16000 -vn test2.wav

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.