# [wavesurfer.js](https://wavesurfer-js.org)
[![npm version](https://img.shields.io/npm/v/wavesurfer.js.svg?style=flat)](https://www.npmjs.com/package/wavesurfer.js)
![npm](https://img.shields.io/npm/dm/wavesurfer.js.svg) [![Join the chat at https://gitter.im/katspaugh/wavesurfer.js](https://badges.gitter.im/katspaugh/wavesurfer.js.svg)](https://gitter.im/katspaugh/wavesurfer.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Interactive navigable audio visualization using Web Audio and Canvas.
[![Screenshot](https://raw.githubusercontent.com/katspaugh/wavesurfer.js/gh-pages/example/screenshot.png "Screenshot")](https://wavesurfer-js.org)
See a [tutorial](https://wavesurfer-js.org/docs) and [examples](https://wavesurfer-js.org/examples) on [wavesurfer-js.org](https://wavesurfer-js.org).
## Browser support
wavesurfer.js works only in [modern browsers supporting Web Audio](http://caniuse.com/audio-api).
It will fallback to Audio Element in other browsers (without graphics). You can also try [wavesurfer.swf](https://github.com/laurentvd/wavesurfer.swf) which is a Flash-based fallback.
## FAQ
### Can the audio start playing before the waveform is drawn?
Yes, if you use the `backend: 'MediaElement'` option. See here: https://wavesurfer-js.org/example/audio-element/. The audio will start playing as you press play. A thin line will be displayed until the whole audio file is downloaded and decoded to draw the waveform.
### Can drawing be done as file loads?
No. Web Audio needs the whole file to decode it in the browser. You can however load pre-decoded waveform data to draw the waveform immediately. See here: https://wavesurfer-js.org/example/audio-element/ (the "Pre-recoded Peaks" section).
## API in examples
Choose a container:
```html
<div id="waveform"></div>
```
Create an instance, passing the container selector and [options](https://wavesurfer-js.org/docs/options.html):
```javascript
var wavesurfer = WaveSurfer.create({
container: '#waveform',
waveColor: 'violet',
progressColor: 'purple'
});
```
Subscribe to some [events](https://wavesurfer-js.org/docs/events.html):
```javascript
wavesurfer.on('ready', function () {
wavesurfer.play();
});
```
Load an audio file from a URL:
```javascript
wavesurfer.load('example/media/demo.wav');
```
## Documentation
See the documentation on all available [methods](https://wavesurfer-js.org/docs/methods.html), [options](https://wavesurfer-js.org/docs/options.html) and [events](https://wavesurfer-js.org/docs/events.html) on the [homepage](https://wavesurfer-js.org/docs/).
## Upgrade
See the [upgrade](https://github.com/katspaugh/wavesurfer.js/blob/master/UPGRADE.md) document if you're upgrading from a previous version of wavesurfer.js.
## Using with a module bundler
Wavesurfer can be used with a module system like this:
```javascript
// import
import WaveSurfer from 'wavesurfer.js';
// commonjs/requirejs
var WaveSurfer = require('wavesurfer.js');
// amd
define(['WaveSurfer'], function(WaveSurfer) {
// ... code
});
```
## Related projects
For a list of projects using wavesurfer.js, check out
[the projects page](https://wavesurfer-js.org/projects/).
## Development
[![Build Status](https://travis-ci.org/katspaugh/wavesurfer.js.svg?branch=master)](https://travis-ci.org/katspaugh/wavesurfer.js)
[![Coverage Status](https://coveralls.io/repos/github/katspaugh/wavesurfer.js/badge.svg)](https://coveralls.io/github/katspaugh/wavesurfer.js)
![Size](https://img.shields.io/bundlephobia/minzip/wavesurfer.js.svg?style=flat)
Install development dependencies:
```
npm install
```
Development tasks automatically rebuild certain parts of the library when files are changed (`start` – wavesurfer, `start:plugins` – plugins). Start a dev task and go to `localhost:8080/example/` to test the current build.
Start development server for core library:
```
npm run start
```
Start development server for plugins:
```
npm run start:plugins
```
Build all the files. (generated files are placed in the `dist` directory.)
```
npm run build
```
Running tests only:
```
npm run test
```
Build documentation with esdoc (generated files are placed in the `doc` directory.)
```
npm run doc
```
If you want to use [the VS Code - Debugger for Chrome](https://github.com/Microsoft/vscode-chrome-debug), there is already a [launch.json](.vscode/launch.json) with a properly configured ``sourceMapPathOverrides`` for you.
## Editing documentation
The homepage and documentation files are maintained in the [`gh-pages` branch](https://github.com/katspaugh/wavesurfer.js/tree/gh-pages). Contributions to the documentation are especially welcome.
## Credits
Initial idea by [Alex Khokhulin](https://github.com/xoxulin). Many
thanks to
[the awesome contributors](https://github.com/katspaugh/wavesurfer.js/contributors)!
## License
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
This work is licensed under a
[BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause).
没有合适的资源?快使用搜索试试~ 我知道了~
前端项目-wavesurfer.js.zip
共160个文件
js:81个
html:29个
json:9个
需积分: 16 9 下载量 182 浏览量
2019-09-03
09:12:48
上传
评论
收藏 4.61MB ZIP 举报
温馨提示
前端项目-wavesurfer.js,Interactive navigable audio visualization using Web Audio and Canvas
资源推荐
资源详情
资源评论
收起资源包目录
前端项目-wavesurfer.js.zip (160个子文件)
.babelrc 477B
CNAME 18B
ribbon.css 3KB
style.css 2KB
main.css 478B
elan.css 349B
app.css 255B
.editorconfig 174B
.gitignore 192B
index.html 13KB
index.html 9KB
index.html 8KB
index.html 8KB
index.html 8KB
index.html 7KB
index.html 7KB
index.html 7KB
index.html 7KB
index.html 6KB
index.html 6KB
index.html 6KB
index.html 5KB
index.html 5KB
index.html 5KB
index.html 5KB
index.html 5KB
index.html 5KB
index.html 5KB
index.html 4KB
index.html 4KB
index.html 4KB
index.html 4KB
index.html 4KB
index.html 4KB
md-player.partial.html 3KB
index.html 3KB
index.html 3KB
md-player-audio.partial.html 1KB
.htmlhintrc 292B
favicon.ico 1KB
wavesurfer.js 49KB
soundtouch.js 36KB
regions.js 31KB
spectrogram.js 22KB
webaudio.js 20KB
timeline.js 19KB
drawer.multicanvas.js 16KB
wavesurfer.directive.js 15KB
microphone.js 13KB
minimap.js 13KB
wavesurfer.spec.js 12KB
drawer.js 11KB
mediaelement.js 10KB
elan.js 10KB
cursor.js 10KB
util.spec.js 9KB
drawer.canvasentry.js 9KB
html-init.js 9KB
mediaelement.spec.js 8KB
fetch.js 7KB
app.js 7KB
plugin-api.spec.js 6KB
main.js 5KB
peakcache.spec.js 5KB
peakcache.js 4KB
karma.conf.js 4KB
main.js 4KB
app.js 3KB
app.js 3KB
observer.js 3KB
mediasession.js 3KB
main.js 3KB
main.js 2KB
app.js 2KB
ajax.js 2KB
app.js 2KB
main.js 2KB
app.js 2KB
trivia.js 2KB
app.js 2KB
main.js 2KB
app.js 2KB
main.js 2KB
app.js 2KB
app.js 2KB
test-helpers.js 1KB
app.js 1KB
.eslintrc.js 1KB
app.js 1KB
plugins.js 1KB
app.js 1KB
main.js 916B
banner.js 894B
main.js 892B
common.js 876B
app.js 874B
main.js 621B
main.js 619B
dev.js 597B
index.js 584B
共 160 条
- 1
- 2
资源评论
weixin_38744375
- 粉丝: 372
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- unity读取excel工具 使用3.5即可
- Matplotlib 是一个 Python 的绘图库 Matplotlib 绘图指南与功能介绍.docx
- 基于TMS320F2808设计光伏并网发电模拟器AD09设计硬件(原理图 PCB)+CCS软件源码 +说明文档.zip
- 在微电网中采用粒子群算法在matlab环境下进行了仿真,最后给出了微网各微源的最优机组组合方式和最佳电能交易计划 (注释完全,可
- 在matlab中通过yalmip平台调用cplex求解器,可用于求解MILP问题,适合于综合能源系统优化求解(注释完全,可直接运
- MT8852B labview 驱动,MT8852B labview 代码,蓝牙测试仪MT8852B代码,蓝牙低功耗测试
- 导照片2.0(只适合索尼微单)
- KMP算法python代码实现与使用场景.docx
- 基于MATLABCPLEX 的机组最优组合,成功求解表格化,图示化的机组组合结果(注释完全,可直接运行)(文档加Matlab源码
- postgresql-9.5.3-1-windows-x64
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功