webaudio-tools
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

webaudio-tools

Useful tools for WebAudio.

npm i webaudio-tools pnpm add webaudio-tools yarn add webaudio-tools

API

# MIDIMessageEvent

    # constructor(type, { data })

# data

    Uint8Array

# receivedTime

    number

# type

    string

# PeakingDetectorNode

    # constructor(ctx)
    # decibelsThreshold  =  -1

      number

    # isPeaking  =  false

      boolean

    # onpeaking()

      onpeaking()  =>

        void

# reset()

    reset()  =>

      void
# PipeNode

    # constructor(context, options)

      # new PipeNode()

        PipeNode

        # context

          BaseAudioContext

        # options

          AudioWorkletNodeOptions & {

          # port

            MessagePort

          }

# context

    BaseAudioContext

# options

    AudioWorkletNodeOptions & {

    # port

      MessagePort

    }
# rpc

    Rpc

# registeredContexts

    Set<BaseAudioContext>

# create(context, options)

    # context

      BaseAudioContext

    # options

      AudioWorkletNodeOptions & {

      # port

        MessagePort

      }

create(context, options)  =>

# register(context)

    # context

      BaseAudioContext

    register(context)  =>

      Promise<void>
# SilenceDetectorNode

    # constructor(context, options)

      # new SilenceDetectorNode()

        SilenceDetectorNode

        # context

          BaseAudioContext

        # options

          AudioWorkletNodeOptions & {

          # processorOptions

            Partial<SilenceDetectorOptions>

          }

# isSilent  =  true

    boolean

# hasRegistered  =  false

    boolean

# onplaying()

    onplaying()  =>

      void
# onsilence()

    onsilence()  =>

      void
# create(context, options)

    # context

      BaseAudioContext

    # options  =  {}

      AudioWorkletNodeOptions & {

      # processorOptions

        Partial<SilenceDetectorOptions>

      }

create(context, options)  =>

# register(context)

    # context

      BaseAudioContext

    register(context)  =>

      Promise<void>
# MidiOp  =  ...

    {

    # NoteOff  =  0x80

      number

    # NoteOn  =  0x90

      number

    }
# createMidiEvent(time, data)

    # time

      number

    # data

      number []

    createMidiEvent(time, data)  =>

      MIDIMessageEvent
# createMidiNoteEvents(time, note, velocity, length)

    # time

      number

    # note

      number

    # velocity

      number

    # length

      number

    createMidiNoteEvents(time, note, velocity, length)  =>

      MIDIMessageEvent []
# dbToFloat(db)

    # db

      number

    dbToFloat(db)  =>

      number
# fetchAudioBuffer(ctx, url)

    # ctx

      AudioContext

    # url

      string

    fetchAudioBuffer(ctx, url)  =>

      Promise<AudioBuffer>
# fftLogIndexer(minFreq, maxFreq, sampleRate, fftSize)

    # minFreq

      number

    # maxFreq

      number

    # sampleRate

      number

    # fftSize

      number

    fftLogIndexer(minFreq, maxFreq, sampleRate, fftSize)  =>

      # (normal)

        # normal

          number

        (normal)  =>

          number
# floatToDb(float)

    # float

      number

    floatToDb(float)  =>

      number

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2023 stagas

Readme

Keywords

Package Sidebar

Install

npm i webaudio-tools

Weekly Downloads

72

Version

2.1.1

License

MIT

Unpacked Size

141 kB

Total Files

48

Last publish

Collaborators

  • stagas