Giter VIP home page Giter VIP logo

wavesurfer.js's Introduction

npm version npm Join the chat at https://gitter.im/katspaugh/wavesurfer.js

Interactive navigable audio visualization using Web Audio and Canvas.

Screenshot

See a tutorial and examples on wavesurfer-js.org.

Browser support

wavesurfer.js works only in modern browsers supporting Web Audio.

It will fallback to Audio Element in other browsers (without graphics). You can also try 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: http://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: http://wavesurfer-js.org/example/audio-element/ (the "Pre-recoded Peaks" section).

API in examples

Choose a container:

<div id="waveform"></div>

Create an instance, passing the container selector and options:

var wavesurfer = WaveSurfer.create({
    container: '#waveform',
    waveColor: 'violet',
    progressColor: 'purple'
});

Subscribe to some events:

wavesurfer.on('ready', function () {
    wavesurfer.play();
});

Load an audio file from a URL:

wavesurfer.load('example/media/demo.wav');

Documentation

See the documentation on all available methods, options and events on the homepage.

Related projects

For a list of projects using wavesurfer.js, check out the projects page.

Development

npm version npm Build Status

Install grunt-cli using npm:

npm install -g grunt-cli

Install development dependencies:

npm install

Build a minified version of the library and plugins. This command also checks for code-style mistakes and runs the tests:

grunt

Generated files are placed in the dist directory.

Running tests only:

grunt test

Creating a coverage report:

grunt coverage

The HTML report can be found in coverage/html/index.html.

Editing documentation

The homepage and the documentation are in the gh-pages branch. Contributions to the documentation are especially welcome.

Credits

Initial idea by Alex Khokhulin. Many thanks to the awesome contributors!

License

cc-by

This work is licensed under a Creative Commons Attribution 3.0 Unported License.

wavesurfer.js's People

Contributors

katspaugh avatar thijstriemstra avatar mwise avatar jabr avatar rgagnon24 avatar fluffywaffles avatar panda-go-panda avatar chrisparton1991 avatar akreal avatar naomiaro avatar fzyukio avatar binron avatar gintelllect avatar nmgtn avatar n-st avatar nabiulin avatar whenov avatar lionelb avatar jbeyer05 avatar seanbannister avatar gapipro avatar ucom avatar therewasaguy avatar jonty-comp avatar tombyrer avatar h0lyalg0rithm avatar stoyvo avatar chinshr avatar dbunker avatar rozap avatar

Watchers

Miguel Lloreda avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.