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

biometrics-dom

v0.1.1

Published

> A Vue.js component,used for segment audio. > 音频切分插件,可展示波形图,分段播放,选区播放等

Downloads

2

Readme

audio_wave_plugin

A Vue.js component,used for segment audio. 音频切分插件,可展示波形图,分段播放,选区播放等

avatar

Build Setup

# install plugin
npm install audio_wave_plugin --save

# using tutorials
	main.js:
	import audioWave from 'audio_wave_plugin';
	Vue.use(audioWave);

	yourPage.vue:  
	# 要引用的页面
	<template>
	  <div id="yourPage">
		<audio-wave style="width:1080px" ref="AudioWave" :tagChooseList="tagChooseList"></audio-wave>
	  </div>
	</template>
	<script>
	export default {
	  data() {
		return {
		  tagChooseList:["偏高","正常","偏低"],//下拉数组
		  audioUrl:
			"http://kolber.github.io/audiojs/demos/mp3/juicy.mp3"
		};
	  },
	  mounted() {
		this.$refs.AudioWave._initAudio(this.audioUrl, []);
	  }
	};
	</script>

attentions

  • 组件最小宽度为1080px
  • 双击进度条打点切分
  • 左上角播放按钮播放全部音频,每个音频段播放按钮播放当前段音频内容
  • 空格播放:波形图上有选区时播放选区内容,没有选区时播放全部音频
  • 重置波形图:清除波形图选区,重新加载波形图

api

1.初始化组件,第一个参数为音频url,第二个参数是分段的数组,分段为空时传[]

this.$refs.AudioWave._initAudio(url,sectionList);

sectionList格式:

    [
        {
            startTime: "0:00.420",//音频段开始时间,分:秒.毫秒
            endTime: "0:01.180",//音频段结束时间,分:秒.毫秒
            tag: 1,//当前标记内容
            startLeft: "8.67%",
            endLeft: "24.33%",
            isPlaySection: false,//音频段播放按钮
            chevronType: false,//音频段是否展开
            chooseTag: false//音频段展开框中选择框是否展开
        }
    ];

2.获取当前切分内容

var tagList = this.$refs.AudioWave.tagList;
console.log(tagList);

3.获取当前切分内容前检测tagList值是否满足要求

console.log( this.$refs.AudioWave.checkTagList() );
  • (1)每个音频段必须有结束标签
  • (2)每个音频段结束时间必须大于开始时间
  • (3)每个音频段必须有标记内容(即下拉框必须有内容值)

返回值有两种:

  • true; //检测通过
  • 错误字符串; //返回具体检测不通过原因