tacus
v1.1.2
Published
tacus is a simple library to recorder audio in browser
Downloads
69
Readme
Tacus
Features
- light. No third party dependencies.
- Easy. Use only 5 API to do every thing about recording and playing.
Instruction
Tacus is a simple library to recorder audio in browser.
Quick Start
Tacus is an simple library for web recording. You only have to learn six methods: open, start, pause, resume, stop, clear.
Installation
Use npm
npm i tacus
import it as ES6 module
import { Tacus } from 'tacus'
Use script
Local
<script src="/path/to/tacus.js"></script>
You can download the latest version from here.
CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tacus.min.js"></script>
Usage
let tacus = new Tacus();
tacus.start();
tacus.stop();
See examples for more details.
API
constructor([config])
Initialize a Tacus instance.
config | parameter | description | type | | ------------- | ------------------ | ------------------------------- | | bufferSize | buffer size | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | | sampleRate | sample rate | 8000 | 16000 | 22050 | 24000 | 44100 | 48000 |
example:
const tacus = new Tacus();
start()
Start recording or playing.
example:
tacus.start();
stop()
Stop recording or playing.
example:
tacus.stop()
pause()
Pause recording or playing.
example:
tacus.pause();
resume()
Resume recording or playing.
example:
tacus.resume();
download
download audio.
example:
tacus.download();
exportWAV
export WAV as array buffer
example:
tacus.exportWAV();