MTG / essentia.js

JavaScript library for music/audio analysis and processing powered by Essentia WebAssembly
https://essentia.upf.edu/essentiajs
GNU Affero General Public License v3.0
627 stars 41 forks source link

Audio Segmentation Issue #106

Closed hussainMansoor876 closed 1 year ago

hussainMansoor876 commented 1 year ago

What is the issue about?

What part(s) of Essentia.js is involved?

Description

... How to get audio segmentation in essentia.js?

Steps to reproduce / Code snippets / Screenshots

-

System info

i.e. Hardware, OS, platform (which browser / version of Node, etc), Essentia.js version... WINDOWS OS Chrome Browser essential version 0.1.3

jmarcosfer commented 1 year ago

Hi @hussainMansoor876

Not sure what type of segmentation you're after. You could segment by pitch, chords, novelty... All of which are available descriptors/algorithms in Essentia.js. You can compute any of these, and then get timestamps by taking the frame each value was detected on, and converting it to time in seconds. With that you could go back to your audio file and cut it into chunks.

Here is a running code example of how to use the NoveltyCurve algorithm, which you could then use to find positions of change in the original audio and do your segmentation (code is in the audio-worker.js script, the main meat is in L42, the analyse function).

You can also have a look at our online onset slicing demo, the main code for it is here. You will need these two additional extractors for algorithms we still don't have in the core library.

Hope that helps!