Indie game development and .NET experiments
Trying out a new audio visualizer for fun 🙂
How do you get the visualization from an audio file in WinRT? Are there any libraries? Thx!
At first I was using NAudio for that ( http://naudio.codeplex.com/ ) and there’s a tutorial attached, but it failed the Store certification.
So now I’m using FMODex ( http://www.fmod.org/ ) which is working for WinRT.
Once you play a sound using FMOD you can retrieve the spectrum like this:
// Get for the left and right channels
var a1 = music._channel.getSpectrum(levelsBufferRight, levelsBufferRight.Length, 0, FMOD.DSP_FFT_WINDOW.HAMMING);
var a2 = music._channel.getSpectrum(levelsBufferLeft, levelsBufferLeft.Length, 1, FMOD.DSP_FFT_WINDOW.HAMMING);
Then it’s all about tweaking the result to make it look “nice”.
And the rendering is doing using a pixel shader btw.
Thank you for the info. 🙂
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Notify me of new posts via email.
Enter your email address to follow this blog and receive notifications of new posts by email.
Join 56 other followers