GML How do I make an audio detector – not detecting a file playing, but detecting a noise inside of the file?

Acid Reflvx

Member
I need some help with making an audio detector that detects, for example, a snare while an audio file is playing that has multiple snares in it. Every time a snare is heard, it will trigger something to spawn, or something. I've looked everywhere, literally everywhere for an answer to this and didn't come up with anything. I'm not too experienced with audio so I would need a full answer instead of an actual real word explanation. I use GameMaker Studio 1.4. Thanks!
 

FoxyOfJungle

Kazan Games
I think you're wondering if it's possible to use the "Fast Fourier Transform (FFT)" algorithm. The Game Maker Studio 2 doesn't support this in a simple way, but you can try to use buffers, I personally haven't seen anyone doing this yet, but I think it's possible. I Never tried it, just once I did some tests and managed to reproduce 8 bit frequencies using buffers.

Anyway, someone made a DLL for Windows, Mac and Linux that it is possible to obtain the audio buffer transformation, I already tested it and it works but it can be a little limited as it is not possible to obtain individual frequencies in separate channels:

 
Top