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

Sample rate has no default value #29

Closed
louisabraham opened this issue Oct 13, 2016 · 6 comments
Closed

Sample rate has no default value #29

louisabraham opened this issue Oct 13, 2016 · 6 comments

Comments

@louisabraham
Copy link
Contributor

When I use yaafe -f "cqt: CQT" KR.mp3 for example, I get the error "ERROR: please specify sample rate !" though the file has a sample rate (I can see it in its metadata), and the help (yaafe -h) specifies :
-r SAMPLE_RATE, --rate=SAMPLE_RATE working samplerate in Hz. If not set, use input file sample rate.

If I add the parameter yaafe -r 44100 -f "cqt: CQT" KR.mp3, it just works fine.

@louisabraham
Copy link
Contributor Author

The error is just here

@thomasfillon
Copy link
Member

Well: It’s not a bug, it’s a feature ! ;-)

The specification of the sample rate is a requirement of the yaafe.py command line.

Let's suppose that you are extracting some audio features for several audio files (which you can do in the same command line see Yaafe manual here).
If the files do not share the same sample rate you would then not be extracting audio features with the same definition.

For example let's consider the default blocksize parameters for the MFCC which default value is 1024. It would not correspond to the same window length in seconds if the samplerate is 32000 or 44100 Hz.

By specifying the sample rate in the yaafe.py command line:

  • you know exactly what you are doing in the time domain (blocksize, stepsize, ...)
  • you are sure to process different files with the same feature extraction parameters

Please also note that Yaafe can do the samplerate conversion if needed see Yaafe manual here.

Is that ok for you ?

@louisabraham
Copy link
Contributor Author

louisabraham commented Oct 18, 2016

I think there is a contradiction between the documentation and the usage.
I am just a beginner in this field, but I think you almost always use the sample rate of the input file. Why not just read it ?
And if not, you should edit the documentation.
I understand that it can be misleading, but IMO yaafe would be much more powerful if you could just like batch extract from several audio files and get the samplerate from the metadata. But after all, just like I said, I am really not an expert.

@thomasfillon
Copy link
Member

I think there is a contradiction between the documentation and the usage.

Do you mean that it is not the usage to extract audio features at a sample rate different from the input file ?

One of the main purpose of Yaafe is to extract audio features from several audio files in order to compare those features. If features were extracted with the same parameters but at different sample rate then it would thus mean that they have been extracted with different parameters so they can not be compared.

@louisabraham
Copy link
Contributor Author

Ok I understand this is not a bug, but a choice.
We should therefore remove "If not set, use input file sample rate." from the documentation.

@thomasfillon
Copy link
Member

OK thank you very much for fixing the help message. I didn't notice the contradiction in the yaafe.py help message.

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

No branches or pull requests

2 participants