Turn Spectro into a library
See original GitHub issueAt the moment Spectro just builds to a demo. It should be turned into a library, with the existing demo being moved into a demo
or examples
folder.
I imagine the API looking something like this:
// Creates a spectrogram attached to the given canvas, provides automatic handling
// of when the canvas is resized
const canvas = document.getElementById('spectrogram-canvas');
const spectrogram = new Spectrogram(canvas);
// Change display parameters of the spectrogram
spectrogram.updateRenderSettings({
zoom: 1.5,
minFrequencyHz: 0,
maxFrequencyHz: 12000,
scale: 'mel',
color: /* object representing a color gradient */
});
// Start recording from mic, will prompt for permissions and return a promise once
// recording has started
await spectrogram.recordFromMic();
// Play audio file, can take URL or File object with option to mute output
await spectrogram.playAudioFile(file, mute = true);
// Manual API where audio data is streamed to the spectrogram
const renderAudioBuffer = await spectrogram.streamAudio();
// Call renderAudioBuffer() each time there is an audio buffer to render, returns a
// promise
// Calling renderAudioBuffer() after a call to stop() is an error
// Stop recording from mic or playing audio file
await spectrogram.stop();
// Add event listener to handle state changes
spectrogram.addStateChangeEventListener((state) => {
// state can be one of 'stopped', 'playing-mic', 'playing-file', or
// 'playing-custom'
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to make a spectral library for a labeled DIA ... - YouTube
Spectronaut Tutorial - How to make a spectral library for a labeled DIA experiment using Pulsar ; Study Looking at Protein Level Degradation: ......
Read more >Spectronaut™ Tutorial - How to make a spectral library for a ...
Tejas Gandhi from our R&D team walks you through the relevant search and library settings so that you can take advantage of labeled...
Read more >Building Color Libraries with your SpectroDensitometer
SpectroDens Calibration Procedure: Press the green button to turn unit “on.” Use up arrow to go to “Calibration.” ; Create Color Book/Library: Connect...
Read more >Support for Spectro 1 by Variable - Color Muse
A: Once the Spectro 1 device has been received, the user can scan and save color standards then periodically check against the color...
Read more >Library Searching - Spectroscopy Online
Regardless of the computer, a library search is performed by mathematically comparing your unknown spectrum to each of the spectra in a ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gokgozf Sorry for the late reply, haven’t really touched any of my Github projects since COVID all started. Now that I’m getting back into things, I’m hoping to make Spectro into a reusable library with an npm package while also keeping this repository maintained. I’ve started by upgrading all of the dependencies, next I’m going to be refactoring the codebase into a library while putting the current demo in a separate directory that uses the new library. No ETA yet as I haven’t worked with the code in a year, but hopefully not too long!
@calebj0seph the sliding DFT can be used to drop m samples and pickup p samples. Most often m = p = 1.
Please contact me at rechmbrs [at] gmail [dot] com to follow on with this. I have a number of other parts to discuss. We can then bring results back here for others.
RONC