1.0.6 • Published 5 years ago

the-audio-util v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

the-audio-util

Build Status npm Version JS Standard

Utility for audio

Installation

$ npm install the-audio-util --save

Usage

'use strict'

const {rmsFor} = require('the-audio-util')

async function tryExample () {
  class SpeechAudioProcessor extends AudioWorkletProcessor {

    process (inputs, outputs) {
      const input = inputs[0]
      const output = outputs[0]
      for (let channel = 0; channel < output.length; ++channel) {
        output[channel].set(input[channel])
        {
          const rms = rmsFor(input[channel])
          this.port.postMessage({rms})
        }
      }

      return true
    }
  }
}

tryExample().catch((err) => console.error(err))

API Guide

License

This software is released under the MIT License.

Links

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago