0.3.0 • Published 8 years ago
audio.io v0.3.0
audio.io
A tiny wraaper of audio APIs.
Classes
AudioPlayer
Usage
MediaRecorder
- A tiny wraaper ofw3c 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