Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/slickcharmer/react-wavesurfer.js

React bindings for wavesurfer.js
https://github.com/slickcharmer/react-wavesurfer.js

canvas react wafesurfer waveform

Last synced: 1 day ago
JSON representation

React bindings for wavesurfer.js

Awesome Lists containing this project

README

        

# react-wavesurfer.js

![Test](https://github.com/amilajack/react-wavesurfer/workflows/Test/badge.svg)
[![NPM version](https://badge.fury.io/js/react-wavesurfer.js.svg)](http://badge.fury.io/js/react-wavesurfer.js)
[![npm](https://img.shields.io/npm/dm/react-wavesurfer.js.svg)](https://npm-stat.com/charts.html?package=react-wavesurfer.js)

## Installation

```bash
# NPM
npm install wavesurfer.js react-wavesurfer.js
# Yarn
yarn add wavesurfer.js react-wavesurfer.js
```

## Basic Usage

See the [live demo](https://codesandbox.io/s/react-wavesurfer-js-w3brk).

```tsx
import React, { useState } from "react";
import Wavesurfer from "react-wavesurfer.js";

function MyWaveform() {
const [position, setPosition] = useState(0);
const [muted, setMuted] = useState(false);

const handlePositionChange = (position) => {
/* ... */
};
const onReadyHandler = () => console.log("done loading!");

return (

);
}
```

## Zooming (Work in Progress)

```tsx
import React, { useState } from "react";
import Wavesurfer from "react-wavesurfer.js";

function MyWaveform() {
const [zoomLevel, setZoomLevel] = useState(0);

const handleInput = (e) => {
setZoomLevel(e.value);
};

return (
<>


>
);
}
```

## Minimap and Timeline (Work in Progress)

```tsx
import React, { useState } from "react";
import Wavesurfer from "react-wavesurfer.js";
import MiniMap from "react-wavesurfer.js/plugins/minimap";
import Timeline from "react-wavesurfer.js/plugins/timeline";

function MyWaveform() {
return (




);
}
```

## Roadmap

- [x] Basic Waveform Usage
- [ ] Regions Plugin Support
- [ ] Timeline Plugin Support
- [ ] Minimap Plugin Support
- [ ] Spectrogram Plugin Support
- [ ] Cursor Plugin Support
- [ ] MediaSession Plugin Support
- [ ] Microphone Plugin Support

## Local Setup

```bash
git clone https://github.com/amilajack/react-wavesurfer.js
cd react-wavesurfer.js
npm install
npm run build
```

## Related

- [wavesurfer.js](https://github.com/katspaugh/wavesurfer.js)
- [react-wavesurfer (Archived)](https://github.com/mspae/react-wavesurfer)

## Credits

Credits go to [mspae](https://github.com/mspae) for starting the [inital work on this](https://github.com/mspae/react-wavesurfer)