AudioVisual

AudioVisual

This a plugin of audio data visualization

av.gif

Have

  • 可视化音频数据
  • 自定义渐变色
  • 支持两种数据接入方式

API

check this file: src/index.ts

Example

check this file: test/index.html

Install

  1. 标签引入
<script src="./dist/AudioVisual.min.js"></script>
  1. 实例化(file可选)
var av = new AudioVisual(audio, canvas[, config]);

Params

                                               
参数 说明 类型 默认值
audio音频节点 HTMLAudioElement
canvas画布 HTMLCanvasElement
config配置 object 参见下面的配置说明 options

options

                                                           
参数 说明 类型 默认值
isAutoRun在音频文件读取完成后立即运行 boolean true
thickness粒度 number 默认 2048 范围 32~32768,必须是2的n次方
colorStops渐变色序列 string[] 内置默认6种渐变色
fileElement文件控件,获取音频文件的入口 HTMLInputElement 可选

Contributing

  • Fork this Repo first
  • Clone your Repo
  • Install dependencies by $ npm install
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Publish your local branch, Open a pull request
  • Enjoy hacking <3

MIT license

Copyright (c) 2018 yangfan2016 <15234408101@163.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


built upon love by docor v0.3.0

Visit original content creator repository https://github.com/Yangfan2016/AudioVisual

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *