A spectrograph web audio component
$ component install web-audio-components/spectrograph
var context = new (AudioContext || webkitAudioContext)()
, buffer = context.createBufferSource()
, Spectrograph = require("spectrograph")
, spec = new Spectrograph(context, {
canvas: canvasEl
});
// Once the source has a buffer, it's routed through the spectrograph
buffer.connect(spec);
spec.connect(context.destination);
For further examples, see the example.
Instantiate a Spectrograph module. Expects an AudioContext
as the first parameter.
Options
speed
Number in milliseconds on how often it should render out the spectrogramrange
Upper bound of frequency rendered (default:11500
)minH
Hue of the minimum amplitude valueminS
Saturation of the minimum amplitude valueminL
Lightness of the minimum amplitude valuemaxH
Hue of the maximum amplitude valuemaxS
Saturation of the maximum amplitude valuemaxL
Lightness of the maximum amplitude value
Connect a Spectrograph module to an AudioNode
.
Disconnect all outgoing connections from a Spectrograph module.
MIT License, Copyright (c) 2013 Jordan Santell