Constructor
new Mel(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Override default parameters. Properties
|
- Source:
- To Do:
-
- - implement Slaney style mel bands
Example
import lfo from 'waves-lfo/node'
// read a file from path (node only source)
const audioInFile = new lfo.source.AudioInFile({
filename: 'path/to/file',
frameSize: 512,
});
const slicer = new lfo.operator.Slicer({
frameSize: 256,
hopSize: 256,
});
const fft = new lfo.operator.Fft({
size: 1024,
window: 'hann',
mode: 'power',
norm: 'power',
});
const mel = new lfo.operator.Mel({
log: true,
nbrBands: 24,
});
const logger = new lfo.sink.Logger({ data: true });
audioInFile.connect(slicer);
slicer.connect(fft);
fft.connect(mel);
mel.connect(logger);
audioInFile.start();
Methods
inputVector(spectrum) → {Array}
Use the Mel
operator in standalone
mode (i.e. outside of a graph).
Parameters:
Name | Type | Description |
---|---|---|
spectrum |
Array | Fft bins. |
- Source:
Returns:
- Mel bands.
- Type
- Array
Example
const mel = new lfo.operator.Mel({ nbrBands: 24 });
// mandatory for use in standalone mode
mel.initStream({ frameSize: 256, frameType: 'vector', sourceSampleRate: 44100 });
mel.inputVector(fftBins);