![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | CrazyM |
![]() |
Old Version | Published before Godot 3 was released. |
I have been looking through the source, trying to find where the audio processing code is that drives the amplitude meter in the top right corner of the editor. I want to read amplitude sample values for beat detection and audio-based interactions, but I can’t find this source. Ultimately, I’d like use it for reference and hopefully expose this type of audio data access to GDscript.
Thanks,
Michael
I just notice now the “amplitude meter in the top right corner of the editor” part of your question. I think this meter is just to track CPU usage and is not related to audio processing; I might be wrong though.
Akien | 2016-02-27 09:56
@Akien, I think it is for audio, as I was able to test it back on 1.1 (or some dev revision after it), and it did so.
Bojidar Marinov | 2016-02-27 12:45
The meter is definitely responding to audio amplitude when previewing sounds in the editor, so the code is already in there somewhere. I’m looking through these editor classes to see if I can track it down as well.
CrazyM | 2016-02-28 16:21
I think I might have found it in the bands.c/h class. I’m assuming godot uses celt as it’s internal codec.
/* Compute the amplitude (sqrt energy) in each of the bands */
void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int M)
CrazyM | 2016-02-28 23:46