Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@teropa/oscilloscope

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teropa/oscilloscope

An oscilloscope for Web Audio nodes

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

Web Audio Oscilloscope

Visualises the waveform of any Web Audio node. Uses simple edge triggering to stabilise the waveform.

Install

npm install @teropa/oscilloscope

ES Modules, CommonJS modules, and an UMD build are all provided.

Usage

Create an oscilloscope and attach it to an existing <canvas> element, then connect it to an AudioNode and start visualising:

import { Oscilloscope } from "@teropa/oscilloscope";

let oscilloscope = new Oscilloscope(myCanvasElement, audioContext, {
  fftSize: 4096,
});
oscilloscope.connect(myAudioNode);
oscilloscope.start();

The canvas visualisatioon will be sized according to the natural (CSS-based) size of the canvas.

The third argument to the constructor supports the following options:

  • fftSize - number - the FFT size of the backing AnalyserNode. This affects how large the visualised time window is.
  • edgeThreshold - number - the threshold that will trigger the oscilloscope's rendering
  • edgeTrigger - rising or falling - whether the edge triggering occurs when the signal rises above, or drops below, the edge threshold.
  • backgroundColor - string - the (CSS) color to use for the visualisation background
  • lineColor - string - the (CSS) color to use for the signal line
  • lineWidth - number - how thick to draw the signal line

FAQs

Package last updated on 27 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc