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

what(): Cannot set out-of-bounds sample #20

Open
sdfgbdfhdfghgf opened this issue May 9, 2022 · 1 comment
Open

what(): Cannot set out-of-bounds sample #20

sdfgbdfhdfghgf opened this issue May 9, 2022 · 1 comment

Comments

@sdfgbdfhdfghgf
Copy link

sdfgbdfhdfghgf commented May 9, 2022

Hello,
after I was finally able to build libkeyfinder and examples/basic.cpp:

$ sudo pacman -S cmake fftw catch2

-> Extract and cd into folder, then:

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/include -S . -B build
$ cmake --build build --parallel 12
$ sudo cmake --install build
$ cd examples/
$ cmake -DCMAKE_INSTALL_PREFIX=/usr/include -S . -B build
$ cmake --build build --parallel 12
$ cd build/

I'm getting this error when I try to run the basic example:

$ ./basic file1.wav
Sample Rate: 44100
Num Channels: 2
Num Samples: 31
terminate called after throwing an instance of 'KeyFinder::Exception'
  what():  Cannot set out-of-bounds sample (31/31)
$ ./basic file2.wav
Sample Rate: 44100
Num Channels: 2
Num Samples: 15125124
terminate called after throwing an instance of 'KeyFinder::Exception'
  what():  Cannot set out-of-bounds sample (15125124/15125124)

(file1.wav was converted using the latest version of ffmpeg on arch linux ($ffmpeg -i file1.mp3 file1.wav, while file2.wav was already in .wav format.)

I tried 3 other files (converted from .mp3 to .wav using $ ffmpeg -i filename.mp3 filename.wav) but unfortunately I get the same error.

Edit
As an alternative I found musical-key-finder and librosa itself to be interesting: librosa creates the chromagram image and musical-key-finder gives further details, based on results from librosa, on which key could be the correct one:

# prints the relative prominence of each pitch class   
# prints the correlation coefficients associated with each major/minor key
# printout of the key determined by the algorithm; if another key is close, that key is mentioned
@5pacedo9
Copy link

5pacedo9 commented Dec 8, 2023

I got the same exception too, but don't know how to solve this.

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