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

evaluater-vkm-wx-public

v0.0.41

Published

Provider evaluater function for vipkid client app

Downloads

1

Readme

语音评测组件

安装语音评测微信公众号SDK

//旧版NPM 不推荐
npm install --save http://npm.vipkid.com.cn/evaluater-vkm-wx-public/-/evaluater-vkm-wx-public-xxx.tgz

//新版NPM 使用私仓
npm install evaluater-vkm-wx-public --save

// 引入Evaluater
import VKEvaluater from 'evaluater-vkm-wx-public'

// 创建实例
var evaluater = new VKEvaluater(...).core

使用语音评测微信公众号SDK

//Ajax获取token

var VKEvaluater = require("../src")
var wx = require('weixin-js-sdk')

//获取微信页面access_token

wx.config({
    //其他微信jssdk使用配置项
    ..

    jsApiList: [
        'startRecord',
        'stopRecord',
        'onVoiceRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'onVoicePlayEnd',
        'uploadVoice',
        'downloadVoice',
        //其他功能列表
    ] // 必填,需要使用的JS接口列表,请务必包含以上录音相关功能
})

wx.ready(function () {
    // 初始化
    var evaluater = new VKEvaluater({
        type: __TYPE__, //如果使用公众号SDK请传入'wx'
        appId: __ISCP_APPID__,
        userId: __USERID__,
        env: __ENV__,
        selfWX: wx, //传入wx对象,必填
        onState: function (state) {
             switch (state.code) {
                case 0: //请参考使用文档 -> 状态码说明
                    ..
                    break;

                ..
             }

        },
        onError: function (error) {
            //..
        },

        onVoiceEnd: function () {
            //..
        }
    }).core;

    //开始按钮
    document.querySelector('#startRecord').onclick = function () {
        // 启动评测
        evaluater.start({
            refText: 'hello',
            textMode: 0,
            evalMode: 0,
            rank: 100,
    })

    //停止按钮
    document.querySelector('#stopRecord').onclick = function () {
        evaluater.stop()
    }

    //播放声音按钮
    document.querySelector('#playVoice').onclick = function () {
        evaluater.playVoice(evaluater.getLocalId());
    }
    //暂停播放声音按钮
    document.querySelector('#pauseVoice').onclick = function () {
        evaluater.pauseVoice(evaluater.getLocalId());
    }
    //停止播放声音按钮
    document.querySelector('#stopVoice').onclick = function () {
        evaluater.stopVoice(evaluater.getLocalId());
    }
})

wx.error(function (res) {
    //..
})

详细使用参见文档 使用文档

历史版本

v 0.0.41 自动化测试打点

v 0.0.34 ~ v 0.0.36 更新时间:2019-010-31 修复SDK在录音停止res为undefined时报错的问题 v 0.0.33 更新时间:2019-04-30 增加SDK初始化时对用户录音的检测功能,在onError回调中响应异常码1102。现在SDK支持中文评测了 v 0.0.32 更新时间:2019-03 优化cancel功能,使其可以兼容取消start状态和stop状态 v 0.0.31 更新时间:2019-03 增加录音取消功能cancel,修复上传vvos无效的问题,修复1106错误码扩展失败的问题,修复localId导致的错误 v 0.0.30 更新时间:2019-03 修改SDK使用方式,现在SDK内部不再进行任何微信API的配置,需要使用者进行传入 v 0.0.28 ~ v 0.0.29 更新时间:2019-03 fixed bug,增加是否开启SDK内部进行微信API申请的配置项,增加SDK后端是否上传vvos音频的配置项 v 0.0.27 更新时间:2019-03 增加初始化showWXProgressTips参数用来控制是否显示微信上传进度条 v 0.0.26 更新时间:2019-02 修复神策重复引用可能导致的bug,应平台要求更改测试环境地址 v 0.0.25 更新时间:2019-02 提供小程序web-view支持 v 0.0.24 更新时间:2019-02 增加SDK getMagicNumber方法,增加appId打点维度 v 0.0.23 更新时间:未知 修改SDK try/catch逻辑,防止外部注入回调函数中的错误在SDK中被错误的抛出 v 0.0.16 ~ v 0.0.22 更新时间:未知 修复了SDK内部因重复引用weixin-js-sdk导致可能出现的问题 v 0.0.14 ~ v 0.0.15 更新时间:未知 根据业务方需求,更新npm包引入方式、SDK使用方式,详情见文档 v 0.0.13 更新时间:未知 根据平台需求,加入magicNumber逻辑并设置userId为必填项 v 0.0.12 更新时间:未知 修复部分低端系统兼容性bug v 0.0.11 更新时间:未知 配合后端提测,更新SDK内部环境接口链接map