Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option for MusicExtractor or FreesoundExtractor to work on raw audio input #765

Closed
009deep opened this issue Jul 19, 2018 · 6 comments

Comments

@009deep
Copy link

009deep commented Jul 19, 2018

MusicExtractor and FreesoundExtractor both accepts only filename as input. If I pass signal value as raw data it errors out as
Couldn't find 'signal' in FreesoundExtractor::inputs.

There should be a way to pass buffer as input to these extractors.

@dbogdanov
Copy link
Member

Agreed, MusicExtractor and FreesoundExtractor also extract some metadata from files, therefore, they should be probably split into a few auxiliary algorithms, one of which would accept raw audio input.

@009deep
Copy link
Author

009deep commented Jul 22, 2018

@dbogdanov In absence of signal option for above extractors, I am using LowLevelSpectralExtractor for deriving mfcc and few other features.

It'll be really helpful if you can add couple of sample codes:

  1. An example showing how to give PCM data as signal input to any algorithm
  2. An example showing how to give a .wav file's content as signal.

I am struggling with both above issues. Any immediate help will be highly appreciated.

@009deep
Copy link
Author

009deep commented Jul 22, 2018

Ignore above comment, I just figured that out.

@dbogdanov dbogdanov changed the title Can't use PCM raw data buffer as input for MusicExtractor or FreesoundExtractor Add an option for MusicExtractor or FreesoundExtractor to work on raw audio input Jul 25, 2018
@ZhiyuLiu1993
Copy link

@009deep hi,could you tell me how to use PCM raw data buffer as input for any algorithm? Thank you!

@009deep
Copy link
Author

009deep commented Dec 10, 2018

@ZhiyuLiu1993 hey sorry for late reply. For PCM data multiply your data with (1/(2^(n-1) -1)) before feeding it to essentia algorithms. Where n is number of bits to represent PCM data so e.g. if you use S16LE format for PCM data.

@009deep 009deep closed this as completed Dec 10, 2018
@stonelazy
Copy link

For PCM data multiply your data with (1/(2^(n-1) -1)) before feeding it to essentia algorithms

@009deep Am sorry for bringing up an ancient thread. I hope you are suggesting to just normalize the input before feeding to Essentia algorithms ? If not, would it be possible to share a snippet or detail more on how to input a wav file to essentia without using MonoLoader or their AudioLoader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants