Page 1 of 1

It seems like there is an issue with my Fourier transform.

Posted: Sun Oct 01, 2023 6:25 am
by qwws
This is error

Error

main.lua:20: size of C type is unknown or too large


Traceback

[love "callbacks.lua"]:228: in function 'handler'
main.lua:20: in function 'update'
[love "callbacks.lua"]:162: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'

Re: It seems like there is an issue with my Fourier transform.

Posted: Mon Oct 02, 2023 9:19 am
by zorg
First of all, your file's character encoding is not utf-8, but GB2312, which it shouldn't be; fix that and keep to it if you don't want random unexplainable errors.

Second, love.sound.newSoundData can directly take a filename, you most definitely do not need to read in the data manually.

Third, the data you get in a SoundData is just phase information, that's not the same data an FFT will make for you... not to mention that it's infinitely simpler to just use SoundData:getSample anyway.

As for the error itself, i'm guessing that you need to actually cast the pointer to a C type for you to be able to index into it.