npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

baidu-yuyin-api

v0.1.9

Published

Nodejs implementation of Baidu Yuyin, support text to speech and speech recognition

Downloads

16

Readme

Baidu Yuyin API

npm version Dependency Status

This is a forked repo of baidu_yuyin. Currently under development, use with caution. The original README is here(in Chinese).

NPM

Usage

Need Nodejs v6 above to run this module.

Installation

npm install baidu-yuyin-api

Examples

var BaiduYuyin = require("baidu-yuyin-api");

// Init Baidu Yuyin API.
// Make sure the apiKey and secretKey are set.
// afplay is default player for Mac OS.
// For windows, can use vlc or wmplayer instead.
var speech = new BaiduYuyin(apiKey, secretKey, 'afplay', null, false); 

// Options
var optt = {tex: 'English testing, Hello world', lan: 'zh'}; // Text to speech, language not support English.
var optcn = {lan: 'zh'};
var opten = {format: 'wav', lan: 'en'};

speech.on('ready', () => {
    // Text to speech
    speech.speak("你好世界")
    .then(() => {
        return speech.speak(null, optt);
    })
    .then(() => {
        return speech.speak("测试结束");
    })
    .then(() => {
        return speech.recognize(fs.readFileSync('./test.pcm'), optcn);
    })
    .then(() => {
        return speech.recognize(fs.readFileSync('./test_en.wav'), opten);
    });
});

Test

Clone the repo to local, and run npm install && npm test.

Change Logs

Update 0.1.9 [2016-12-02]

  • Fix the auto renew session token

Update 0.1.8 [2016-12-01]

  • Make sure only renew session file when necessary
  • Minor fixes on README
  • Correct miss spelling words

Update 0.1.7 [2016-11-30]

  • Fix the samples in README
  • Add test API key in config.json
  • Auto renew session token if it expired (30 days)

Update 0.1.6 [2016-11-29]

  • Update README
  • Update test samples
  • Text to speech not support English output

Update 0.1.4 [2016-11-29]

  • Supporting speech recognition
  • Using NODE_DEBUG=request node test.js to test HTTP request

Update 0.1.3 [2016-11-28]

  • Using Linux file system
  • Support wmplayer and vlc player on Windows platform

Update 0.1.2 [2016-11-27]

  • Rewrite code style
  • Fix minor issues