mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Fixed mac/nix build to exclude fftw and use VLC's fft instead.
This commit is contained in:
parent
30aba00e23
commit
d41f44deaf
@ -59,8 +59,6 @@ set (musikbox_LINK_LIBS
|
||||
${linux_LINK_LIBS}
|
||||
${BOOST_LINK_LIBS}
|
||||
dl
|
||||
fftw3
|
||||
fftw3f
|
||||
)
|
||||
|
||||
include_directories (
|
||||
@ -145,4 +143,4 @@ install(
|
||||
OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
||||
GROUP_EXECUTE GROUP_READ GROUP_WRITE
|
||||
WORLD_EXECUTE WORLD_READ
|
||||
)
|
||||
)
|
||||
|
@ -27,6 +27,7 @@ set(CORE_SOURCES
|
||||
./support/PreferenceKeys.cpp
|
||||
../3rdparty/src/md5/md5.c
|
||||
../3rdparty/src/sqlite/sqlite3.c
|
||||
../3rdparty/src/fft.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
|
@ -195,14 +195,14 @@ bool Buffer::Fft(float* buffer, int size) {
|
||||
|
||||
int count = this->sampleSize / FFT_BUFFER_SIZE;
|
||||
|
||||
/* de-interlace the audio first */
|
||||
float* deinterlaced = new float[FFT_BUFFER_SIZE * count];
|
||||
/* de-interleave the audio first */
|
||||
float* deinterleaved = new float[FFT_BUFFER_SIZE * count];
|
||||
for (int i = 0; i < count * FFT_BUFFER_SIZE; i++) {
|
||||
const int to = ((i % this->channels) * FFT_BUFFER_SIZE) + (i / count);
|
||||
deinterlaced[to] = this->buffer[i];
|
||||
deinterleaved[to] = this->buffer[i];
|
||||
}
|
||||
|
||||
/* if there's more than one set of interlaced data then
|
||||
/* if there's more than one set of interleaved data then
|
||||
allocate a scratch buffer. we'll use this for averaging
|
||||
the result */
|
||||
float* scratch = nullptr;
|
||||
@ -216,7 +216,7 @@ bool Buffer::Fft(float* buffer, int size) {
|
||||
fft_perform(this->buffer, buffer, state);
|
||||
|
||||
for (int i = 1; i < count; i++) {
|
||||
fft_perform(&deinterlaced[i * FFT_BUFFER_SIZE], scratch, state);
|
||||
fft_perform(&deinterleaved[i * FFT_BUFFER_SIZE], scratch, state);
|
||||
|
||||
/* average with the previous read */
|
||||
for (int j = 0; j < FFT_BUFFER_SIZE; j++) {
|
||||
@ -224,7 +224,7 @@ bool Buffer::Fft(float* buffer, int size) {
|
||||
}
|
||||
}
|
||||
|
||||
delete[] deinterlaced;
|
||||
delete[] deinterleaved;
|
||||
delete[] scratch;
|
||||
|
||||
fft_close(state);
|
||||
|
Loading…
Reference in New Issue
Block a user