The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: the_nemesis on May 15, 2005, 10:10:45 PM

Title: Oscilloscope in windows
Post by: the_nemesis on May 15, 2005, 10:10:45 PM
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.
Title: Re: Oscilloscope in windows
Post by: BogdanOntanu on May 16, 2005, 06:59:06 AM
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
Title: Re: Oscilloscope in windows
Post by: the_nemesis on May 16, 2005, 05:28:00 PM
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.
Title: Re: Oscilloscope in windows
Post by: Tedd on May 17, 2005, 11:10:33 AM
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)