Reputation: 51
I want to show a wav file as an image, so the frequency is charted on screen like you would see in a wav editor. Any ideas?
Upvotes: 1
Views: 2755
Reputation: 68992
See Chapter 10 Page 379 in Swing Hacks for an example.
Note it doesn't display the frequencies in the signal. You probably want to draw the amplitude of an audio signal, as an wav-editor would do.
Upvotes: 0
Reputation: 2322
This is a rough answer, you have to investigate a little more with these keywords...First you need an FFT-function ( http://en.wikipedia.org/wiki/FFT ), I'd suggest you try to find a lib or source-code, no need to reinvent the wheel. Then you apply that FFT-function to a moving window. So:
In the end each window stands for a x-value (time), and the values of the spectrum represent the y-value (frequencies). That way you have your image.
I hope this is half-way understandable. It's hard to explain with just a few words. Good luck. :-)
Upvotes: 5