meyda | Audio feature extraction for JavaScript | Audio Utils library
kandi X-RAY | meyda Summary
kandi X-RAY | meyda Summary
Meyda is a Javascript audio feature extraction library. Meyda supports both offline feature extraction as well as real-time feature extraction using the Web Audio API. We wrote a paper about it, which is available here.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of meyda
meyda Key Features
meyda Examples and Code Snippets
Community Discussions
Trending Discussions on meyda
QUESTION
I am converting a Python program to Node.js, the program follows these steps:
- Microphone listens with callbacks
- Callbacks do a Librosa "log_mel_S" extraction
- The "log_mel_S" is inferenced by an AI model
- Sound is labeled
I have managed to translate all of the steps and their relatives from Python to Node.js, except for the Librosa extraction. This would be an example for the audio shape and type required:
...ANSWER
Answered 2021-Aug-21 at 13:00TL;DR
Amplitude Spectrum
is basically FFT of the signal, and Power Spectrum
is a squared value of the Amplitude Spectrum
, which is also referred as energy sometimes.
Here is one of examples from Meyda website that is calculating Amplitude Spectrum
https://github.com/catalli/audiotrainer-server/blob/df41322906c88cd6f899e8f9b9661ebb949f72e1/index.js#L17
Long answer:
Now, lets look into your code sample line by line and figure out what is it doing and how to implement it in javascript.
S = numpy.abs(librosa.stft(y=audio_sample, n_fft=1024, hop_length=500)) ** 2
this is calculating square values of 1024 bins fft of audio_sample y, which is basically a Power Spectrum
or an Amplitude Spectrum
squared. Please note that the abs
of complex number is a vector lenth: sqrt(real_part^2 + img_part^2)
mel_S = numpy.dot(librosa.filters.mel(sr=44100, n_fft=1024, n_mels=64), S).T
this is an mfcc calculation, which is basically a product of predefined filter banks and fft squared.
log_mel_S = librosa.power_to_db(mel_S, ref=1.0, amin=1e-10, top_db=None)
this last one will convert the result to decibel (dB) units (10 * log10(S / ref)
)
i will extend this answer with js code-sample later, submitting it now because i think it will be helpful already as it is
QUESTION
I don't know if I am missing something but I can't manage to debug this very simple Node JS program with VS Code (I'm on a Ubuntu env) :
When I start debugging, my breakpoint is "set but not yet bound". The strange thing is that the execution will stop on exceptions if I ask it to, but it will NEVER stop on my breakpoints.
My launch.json file is as follows :
Thank you for your answers.
...ANSWER
Answered 2020-Apr-22 at 10:13I found a workaround. There is a bug on breakpoints in VS Code and to get it work :
1 - Write an exception on your code at the begginning 2 - Debug your app. It should stop on the exception 3 - While it is stopped on the exception, set your breakpoints 4 - Remove the exception code 5 - The next time you debug, breakpoints should be hit !
QUESTION
I wrote the following to draw a sound wave from AudioBuffer but what I get is a canvas with a straight horizontal line:
...ANSWER
Answered 2020-Apr-15 at 20:53I think two little changes are necessary to make it work.
source.start()
needs to be executed in response to a user event. A simple button with a click handler can be used to achieve that. This is necessary to deal with the autoplay policy which is present in some browsers.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install meyda
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page