audio.io

0.3.0 • Public • Published

audio.io

A tiny wraaper of audio APIs.

Classes

  • AudioPlayer

Usage

  • MediaRecorder - A tiny wraaper of w3c MediaRecorder
import { MediaRecorder } from 'audio.io'

const recorder = new MediaRecorder()

recorder.start()

// ...

recorder
  .exportAudio()
  .then(audioBlob => ...)
  • AudioPlayer
import { AudioPlayer } from 'audio.io'

const player = new AudioPlayer()

player
  .load('your-url.mp3')
  .then(() => player.play())
  • AudioRecorder
import { AudioRecorder, getDownloadLink } from 'audio.io'

const recorder = new AudioRecorder({
  workerPath: 'build/recorder-worker.js'
})

recorder.start()

setTimeout(() => {
  recorder.stop()

  recorder
    .exportAudio()
    .then(audioBlob => getDownloadLink(audioBlob, 'kiku.wav'))
    .then(a => ...)
}, 60000)

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i audio.io

Weekly Downloads

1

Version

0.3.0

License

MIT

Last publish

Collaborators

  • coderhaoxin