I did not know what to call the subject but it does explain the problem. If I move the open window, therefore giving it focus, the spectrum analyser stops until I release the window. The same happens when I have a listbox and click on the scroll bars. How do I keep the spectrum working whenever something else has focus?
- tbe asked 14 years ago
This is the Spectrum Code, Amplifier is a value that can be adjusted on screen to compensate for the diiferent volumes that sounds have been recorded at, it also allows you to turn up the spectrum display when the sound volume is lowered.
Private Sub Oscilater4() ‘Uses all 512 Pieces of SpectralData
Loopy = 0
If FSOUND_DSP_GetActive(FSOUND_DSP_GetFFTUnit) > 0 Then
iy2 = picSpectrum.ScaleHeight / 2
Do While Loopy <> 512
iy1 = SpectralData(Loopy) * (picSpectrum.ScaleHeight / 6 * Amplifier)
ix1 = ix1 + (picSpectrum.ScaleWidth / 511)
ix2 = ix1
picSpectrum.Line (ix1, picSpectrum.ScaleHeight / 2 + iy1)-(ix2, picSpectrum.ScaleHeight / 2 – iy1), RGB(157, 194, 141), BF
If ix1 > picSpectrum.ScaleWidth Then
ix1 = 0
Loopy = Loopy + 1
ix1 = 0
‘Enable it first
FSOUND_DSP_SetActive FSOUND_DSP_GetFFTUnit, 1
Hope you guys can help with the problem
Because Visual Basic is Single Threaded, it will hold everything else as long as you are holding the title bar and moving it.
It might be that code inside a Timer are still loaded, so you might try to work with a timer.
Another possibility is to write your own window moving code, which will update the graphics from time to time.
- Adion answered 14 years ago
Please login first to submit.