How to make a simple audio oscilloscope?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
HolgiB
Posts: 6
Joined: Fri Jan 12, 2007 12:19 am

How to make a simple audio oscilloscope?

Post by HolgiB »

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
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

thats pretty trivial, something like that:

for(i=0;i<size;i++)
{
putpixel(i,halfsize+(audiobuffer/somefactor));
}

do that after every swap of the audio buffer and you'll get something like the scope visualisation in xmms/winamp
HolgiB
Posts: 6
Joined: Fri Jan 12, 2007 12:19 am

Post by HolgiB »

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
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

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)
Post Reply