Comments (5)
That would be a good feature to have. At the moment it is not supported. I'm happy to merge in a PR if you or someone else is able to fork it and add this functionality
from spectrogram.
@miguelmota Can you give some tips about how to draw at once by reading the full audio file?
from spectrogram.
I was curious too, so I looked at the wavesurfer's spectrogram example page and set a breakpoint where they grab the audio buffer and calculate the spectrum. When the breakpoint is hit, I follow up the call stack and notice they call a web audio method that spectrogram.js doesn't (disregard that, it is called and I'm idiot who can't read manuals): decodeAudioData. I'll try to see if I can get spectrogram.js to do the same.
from spectrogram.
I was sorely mistaken. Both wavesurfer and spectrogram.js grab the entire audio buffer, so why is wavesurfer drawing the whole spectrum at once while spectogram only draws one at a time as the audio plays? Waverunner grabs the entire PCM data and does it's own FFT calculation while spectrogram.js uses the built in web audio analyser.
Quickly looking at AnalyserNode, I'm not seeing a way to grab the frequency samples for the entire audio buffer. Oh dear 😅
from spectrogram.
If you're wondering why Waverunner uses it's own FFT, it's not because AnalyserNode can't sample the entire audio buffer. There is a way to work around that, but it's fraught with error. Waverunner used to use onaudioprocess
like spectrogram.js does and that audio process was run in an OfflineAudioContext, which, as the commit notes, has problems on webkit browsers.
Pretty much, if you want to avoid rolling out your own FFT for this use case, we have to wait for AudioWorklets to be supported by both webkit and firefox
from spectrogram.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spectrogram.