| View previous topic :: View next topic |
| Author |
Message |
HolgiB
Joined: 12 Jan 2007 Posts: 6
|
Posted: Wed Jan 24, 2007 9:51 pm Post subject: How to make a simple audio oscilloscope? |
|
|
I am working on an audio player application for the PSP, based on SDL.
It would be nice to have something moving in the player GUI. So my idea was to integrate a kind oscilloscope like many player apps have.
I googled a lot but still not found a small example or informations about something like that can be realized.
Anybody here can tell me something about this or where I can find a good example?
Holger |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
Posted: Wed Jan 24, 2007 11:08 pm Post subject: |
|
|
thats pretty trivial, something like that:
for(i=0;i<size;i++)
{
putpixel(i,halfsize+(audiobuffer[i]/somefactor));
}
do that after every swap of the audio buffer and you'll get something like the scope visualisation in xmms/winamp _________________ http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/ |
|
| Back to top |
|
 |
HolgiB
Joined: 12 Jan 2007 Posts: 6
|
Posted: Thu Jan 25, 2007 12:23 am Post subject: |
|
|
Thank you! I was already looking at Fourier which looked way to complicate for me :-).
This looks really easy. So I will have to experiment with the values a little to get a good result.
Holger |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
Posted: Thu Jan 25, 2007 8:14 pm Post subject: |
|
|
hehe...the fourier transformation you would need to do an "equalizer" type of visualisation. (although if all you want is visualisation you can get away with simpler, not terribly accurate, stuff) _________________ http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/ |
|
| Back to top |
|
 |
|