npm promulgates marsupials
Introducing npm Teams! Private packages + team management tools.Learn more »

soundrecorder

0.0.3 • Public • Published

SoundRecorder

SoundRecorder is a website sound recorder SDK base on h5 api.

  • Sdk-based Base on some h5 api, such as mediaStream, mediaRecorder, audioContext
  • browser supprot: It just build for PC website record, this sdk is unsupport for h5

Installation

SoundRecorder build by umd, you can use it by 2 ways:

  • just append the <script src="/dist/soundRecorder.min.js"></script> tag into the html.
  • or you can import soundrecorder in to your js.

Usage

SoundRecorder is very easy to use, You can read the full demo here or read the code

  // 1. instance the SoundRecorder
  var sr = new SoundRecorder() 

  // 2. start
  sr.start()

  // 3. stop
  sr.stop()

  // 4. get the recorded file
  var blob = sr.getBlob()
  console.log(blob)

Documentation

there the methods of SoundRecorder instance

startRecord(options)
type: Function
args: options
default: {}
description: start mediaRecorder


stopRecord
type: Function
args: options
default: {}
description: stop mediaRecorder


getBlob
type: Function
args: options
default: {}
description: get recorded blob, the blob is build by all chunks


on(String, Function)
type: Function
args: options
default: {}
description: add the event listener callback

Install

npm i soundrecorder

DownloadsWeekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

18.1 kB

Total Files

11

Last publish

Collaborators

  • avatar