@accentdotai/speech-events 中文文档教程

发布于 7年前 浏览 22 项目主页 更新于 3年前

Speech Events

A plugin for detecting speech events in audioContext instances

托管在 Github :octopus:

这个库驱动在 Accent.ai


Syntax

Constructor

var speechEvents = new speechEventsConst({
                         speechStatusCB: (status) => {
                           console.log(status);
                         },
                         speechDetectionAllowedDelay: 1000,
                         speechDetectionThreshold: 40,
                         speechDetectionMaximum: this.recordingMaxLength,
                       });

创建语音事件分析器实例。

  • config - (optional) A configuration object (see Config section below)

Config

  • speechStatusCB
  • errorCB
  • detectOnly
  • concatenateMaxChunks
  • speechDetectionAllowedDelay
  • speechDetectionMinimum
  • speechDetectionMaximum
  • bufferSize
  • analysisChunkLength
  • inputSampleRate
  • speechDetectionThreshold
  • compressPauses

Instance Methods

/**
  * Connect audio context and media stream to this speech analysis class instance.
  * @param {AudioContext} audioContext The audio context gotten from `getUserMedia` caller.
  * @param {MediaStream} realAudioInput Media stream node.
  */
speechEvents.connectStreamSourceProcessor(audioContext, realAudioInput);

speechEvents.startAnalysis();
speechEvents.stopAnalysis();

Bugs?

提交问题到:https://github.com/accentdotai/speech-events/issues

Development

这个包可以用作为 ES6 Node.js 模块和浏览器库。

Node.js 导入使用文件 src/speech-events.js

注意: 目前此包只能在兼容 ES6 的 Node.js 应用下使用。

Webpack 用于构建浏览器兼容的 lib/speech-events.js 文件,该文件稍后会被丑化(使用 uglify-js)到 dist/speech-events .min.js。

Scripts

为了便于开发,以下脚本在 package.json 中定义:

npm run lint
npm run build

有关这些如何工作的更多信息,只需检查 package.json 中的脚本定义。

TODO

  • Add jasmine tests
  • Make Node.js module version which is compatible with non ES6 apps.

License (MIT)

版权所有 © 2017 Jean M. Lescure

Speech Events

A plugin for detecting speech events in audioContext instances

Hosted in Github :octopus:

This library drives the speech events detected on Accent.ai.


Syntax

Constructor

var speechEvents = new speechEventsConst({
                         speechStatusCB: (status) => {
                           console.log(status);
                         },
                         speechDetectionAllowedDelay: 1000,
                         speechDetectionThreshold: 40,
                         speechDetectionMaximum: this.recordingMaxLength,
                       });

Creates a speech events analyzer instance.

  • config - (optional) A configuration object (see Config section below)

Config

  • speechStatusCB
  • errorCB
  • detectOnly
  • concatenateMaxChunks
  • speechDetectionAllowedDelay
  • speechDetectionMinimum
  • speechDetectionMaximum
  • bufferSize
  • analysisChunkLength
  • inputSampleRate
  • speechDetectionThreshold
  • compressPauses

Instance Methods

/**
  * Connect audio context and media stream to this speech analysis class instance.
  * @param {AudioContext} audioContext The audio context gotten from `getUserMedia` caller.
  * @param {MediaStream} realAudioInput Media stream node.
  */
speechEvents.connectStreamSourceProcessor(audioContext, realAudioInput);

speechEvents.startAnalysis();
speechEvents.stopAnalysis();

Bugs?

Submit issues to: https://github.com/accentdotai/speech-events/issues

Development

This package can be used both as an ES6 Node.js module and a Browser library.

Node.js imports use the file src/speech-events.js.

NOTE: Currently this package can only be used under Node.js apps compatible with ES6.

Webpack is used to build the browser-compatible lib/speech-events.js file which is later uglified (using uglify-js) into dist/speech-events.min.js.

Scripts

The following scripts are defined within package.json for ease of development:

npm run lint
npm run build

For more info on how these work simply checkout the script definitions within package.json.

TODO

  • Add jasmine tests
  • Make Node.js module version which is compatible with non ES6 apps.

License (MIT)

Copyright © 2017 Jean M. Lescure

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文