webaudio-tools

Useful tools for WebAudio.
npm i webaudio-tools
|
pnpm add webaudio-tools
|
yarn add webaudio-tools
|
API
# MIDIMessageEvent
# constructor(type, { data })
# data
# receivedTime
# type
# PeakingDetectorNode
# constructor(ctx)
# decibelsThreshold = -1
# isPeaking = false
# onpeaking()
# reset()
# PipeNode
# constructor(context, options)
# context
# options
# rpc
# registeredContexts
# create(context, options)
create(context, options) =>
# register(context)
# SilenceDetectorNode
# constructor(context, options)
# new SilenceDetectorNode()
# isSilent = true
# hasRegistered = false
# onplaying()
# onsilence()
# create(context, options)
# context
# options = {}
AudioWorkletNodeOptions & {
# processorOptions
}
create(context, options) =>
# register(context)
# MidiOp = ...
# createMidiEvent(time, data)
# time
# data
createMidiEvent(time, data) =>
# createMidiNoteEvents(time, note, velocity, length)
# time
# note
# velocity
# length
createMidiNoteEvents(time, note, velocity, length) =>
# dbToFloat(db)
# fetchAudioBuffer(ctx, url)
# ctx
# url
fetchAudioBuffer(ctx, url) =>
# fftLogIndexer(minFreq, maxFreq, sampleRate, fftSize)
# minFreq
# maxFreq
# sampleRate
# fftSize
fftLogIndexer(minFreq, maxFreq, sampleRate, fftSize) =>
# floatToDb(float)
# float
floatToDb(float) =>
Credits
-
pipe-processor by
stagas – AudioWorklet that pipes its output to a given message port.
Contributing
Fork or edit and submit a PR.
All contributions are welcome!
License
MIT © 2023 stagas