I have created a program using MASM32 that plays some music (XM) I was wondering if someone could start me in the right direction for creating an oscilloscope or spectrum analyser.
I guess I would need some calls to the sound card api but don't know where to go from here.
Thanks in advance for any help.
That is not connected with the sound card.
I guess you mean visualization of the music you play and not of the recording/input stream in realtime.
Anyway for an osciloscope just plot the sample's amplitude over time
for spectrum analyser just use some frequency filters or a FFT transform
I actually have a lib a friend wrote that plays XM audio, i don't have any way to check the samples amplitude, thats why i thought i'd have to read it from the sound card, I don't mind of other sounds in the system gets tracked into the wave as well.
You need to get at the wave data before it's sent to the sound card - if at all possible.
Reading the data back from the sound card is very slow at best, and not allowed at worst :bdg
If you can get the source code for the lib, then you could have a callback or something that allows you to access the wave data before it's locked and given to the soundcard. (Or convince your friend it's a good idea :wink)