# react-audio-vision

> A react component that visualizes audio files

Latest version **0.1.1** (published 2018-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-audio-vision
pnpm add react-audio-vision
yarn add react-audio-vision
bun add react-audio-vision
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-07-25 |
| First published | 2018-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 32.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Leopoldthecoder |
| Maintainers | yi.yang |
| Keywords | react, audio, visualize |

## Links

- npm: https://www.npmjs.com/package/react-audio-vision
- npm.io page: https://npm.io/package/react-audio-vision

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2018-07-25
- 0.1.0 — 2018-07-25

## README

# react-audio-vision

### Demo
https://jsfiddle.net/leopoldthecuber/2dovasye/

### Install

#### npm
```bash
npm install react-audio-vision
```

#### script tag
```html
<script src="https://unpkg.com/react-audio-vision"></script>
```

### Usage

#### npm
```js
import React, { Component } from 'react'
import AudioVision from 'react-audio-vision'

class App extends Component {
  render() {
    return (
      <AudioVision />
    )
  }
}
```

#### script tag
```js
class App extends React.Component {
  render() {
    return (
      <AudioVision />
    )
  }
}
```

### API
```html
<AudioVision
  // audio source, can be a string (a url that triggers an XMLHttpRequest) or a blob
  // 音频源，字符串（音频的 url 地址，会触发 XMLHttpRequest 请求）或 Blob 类型
  src={src}

  // canvas width, number
  // canvas 的宽度，数字类型
  width={500}

  // canvas height, number
  // canvas 的高度，数字类型
  height={250}

  // number of bars, must be a power of two in the range of [16, 16384]
  // 色块的数量，必须是在 [16, 16384] 范围内的 2 的幂
  bars={128}

  // color of bars, can be a string or a string array
  // 色块的颜色，字符串或字符串数组
  barColor={['crimson', 'gold']}

  // pause the audio or not, boolean
  // 是否暂停播放，布尔型
  pause={pause}

  // audio play volume, number between 0 and 1
  // 音频播放音量，介于 0 和 1 之间的数字
  volume={0.6} />
```

---
_Source: https://npm.io/package/react-audio-vision · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
