How to use audio amplitude to affect visual brightness?

Is it possible to use audio to drive a dynamic material or light so that the material/light is brightest when the amplitude is highest and darkest when it’s at equilibrium/silence?

I’ve posted this in blueprints but if its possible in C++ that would also be great!

Any ideas as to how to get the relevant values out of a wave file, during run time, would be a huge help! Many thanks…

Edit: After a bit of research it looks like I can use Matlab to produce an array thats a series of values- floats that represent average amplitude at intervals of time. So my question now is, how do I use that info to drive light brightness over time, without having to manually input it into a timeline?

Use an external program like Matlab or Accord.Net to plot the curve, import into the editor and then select the external curve in a timeline;

hello friend, I am trying to import a MatLab curve into the Unreal …

In what format do I save the file within matlab … I could not find the type format.'s …

Files tipe AS not found in Save As in MatLab

Hi CrashAngel, I’m using .csv. The first value is time, the second is audio magnitude, frequency or whatever I’m using in the y dimension. Remember to separate each pair of values with \r\n or the cells will be in the wrong axis…

However, I’m using the C# library Accord.NET. If Matlab doesn’t save to .csv then I should remove it from my answer…

It looks like it does (Not recommended) Write comma-separated value file - MATLAB csvwrite - MathWorks United Kingdom

However, if the pairs arent arranged vertically, then this function doesnt insert \r\n and the engine won’t import it.

Hey btw, seen this?

http://mirlab.org/jang/books/audiosignalprocessing/matlab4waveRead.asp?title=4-2+Reading+Wave+Files

Matlab looks like its got some useful tools for this.

I’ve been doing some more messing around with Matlab, it’s blindingly fast. You can use MfigExtract to pull the x and y from a .fig plotted curve. It saves it as an .xls file- so it’s a piece of ■■■■ to write a little program to extract the data you want from that and save it as a .csv…