forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to make a simple audio oscilloscope?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
HolgiB



Joined: 12 Jan 2007
Posts: 6

PostPosted: Wed Jan 24, 2007 9:51 pm    Post subject: How to make a simple audio oscilloscope? Reply with quote

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
View user's profile Send private message
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Wed Jan 24, 2007 11:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
HolgiB



Joined: 12 Jan 2007
Posts: 6

PostPosted: Thu Jan 25, 2007 12:23 am    Post subject: Reply with quote

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
View user's profile Send private message
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Thu Jan 25, 2007 8:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group