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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
qwws
Prole
Posts: 10
Joined: Fri Aug 25, 2023 11:40 am
Location: Guangdong Province,China

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

Post 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'
Attachments
main.lua
(805 Bytes) Downloaded 120 times
::Hello::
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 14 guests