# use-is-audio-active

> It is react custom hook to detect whether provided audio source is active

Latest version **1.0.0** (published 2022-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-is-audio-active
pnpm add use-is-audio-active
yarn add use-is-audio-active
bun add use-is-audio-active
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-10-23 |
| First published | 2022-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 614.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Olzhas Kurikov, Dinmukhamed Sailaubek |
| Maintainers | olzh2102 |

## Links

- npm: https://www.npmjs.com/package/use-is-audio-active
- Repository: https://github.com/olzh2102/use-is-audio-active
- Homepage: https://github.com/olzh2102/use-is-audio-active#readme
- Issues: https://github.com/olzh2102/use-is-audio-active/issues
- npm.io page: https://npm.io/package/use-is-audio-active

## Recent versions

- 1.0.0 (latest) — 2022-10-23

## README

# use-is-audio-active

> It is react custom hook to detect whether provided audio source is active

[![NPM](https://img.shields.io/npm/v/use-is-audio-active.svg)](https://www.npmjs.com/package/use-is-audio-active) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save use-is-audio-active
```

## Usage

```tsx
import * as React from 'react'

import useIsAudioActive from 'use-is-audio-active'

const Example = () => {
  const [stream, setStream] = React.useState(null)
  const isActive = useIsAudioActive({ source: stream });

  React.useEffect(() => {
    (async function createStream() {
      const stream = await navigator.mediaDevices.getUserMedia({
        audio: true,
        video: true,
      });
      setStream(stream)
    })()
  }, [])  
  
  return (
    <p>
      Am I speaking: {' '} { isActive ? 'yes, you are 🕺' : "seems like ain't 🦻" }
    </p>
  )
}
```

## License

MIT © [olzh2102](https://github.com/olzh2102) [evitla](https://github.com/evitla)

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