Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/audio-utils
Audio utils.
https://github.com/afeiship/audio-utils
audio check helper media permission utility utils
Last synced: 12 days ago
JSON representation
Audio utils.
- Host: GitHub
- URL: https://github.com/afeiship/audio-utils
- Owner: afeiship
- License: mit
- Created: 2017-03-07T01:10:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T13:00:30.000Z (11 months ago)
- Last Synced: 2024-10-06T19:41:34.741Z (about 1 month ago)
- Topics: audio, check, helper, media, permission, utility, utils
- Language: TypeScript
- Homepage:
- Size: 224 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# audio-utils
> Audio utils.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
yarn add @jswork/audio-utils
```## usage
```js
import { checkPermission, watchAmplitude } from '@jswork/audio-utils';// checkPermission
checkPermission().then((res) => {
console.log(res);
});// watchAmplitude when recorder
useEffect(() => {
if (!isPlaying) return;
const res = watchAmplitude({
type: 'recorder',
context: recorder,
callback: (v) => {
console.log('volumn: ', v);
},
});
return res.destroy;
}, [isPlaying]);// watchAmplitude when howler
useEffect(() => {
if (!isPlaying) return;
const res = watchAmplitude({
type: 'howler',
context: Howler,
callback: (v) => {
console.log('volumn: ', v);
},
});
return res.destroy;
}, [isPlaying]);// watchAmplitude when audio
useEffect(() => {
if (!isPlaying) return;
const res = watchAmplitude({
type: 'audio',
context: document.querySelector('#audio1'),
callback: (v) => {
console.log('volumn: ', v);
},
});
return res.destroy;
}, [isPlaying]);```
## types
```ts
///
```## license
Code released under [the MIT license](https://github.com/afeiship/audio-utils/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/audio-utils
[version-url]: https://npmjs.org/package/@jswork/audio-utils[license-image]: https://img.shields.io/npm/l/@jswork/audio-utils
[license-url]: https://github.com/afeiship/audio-utils/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/audio-utils
[size-url]: https://github.com/afeiship/audio-utils/blob/master/dist/index.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/audio-utils
[download-url]: https://www.npmjs.com/package/@jswork/audio-utils