0
0

Just insert 1 picturebox…and put sound file “wave.wma” in same path
Form code:

Option Explicit

Dim system As Long
Dim Sound As Long
Dim channel As Long

Private Sub Form_Load()
Picture1.ScaleMode = 3
Picture1.DrawMode = 13
Dim result As FMOD_RESULT
Dim version As Long
Dim exinfo As FMOD_CREATESOUNDEXINFO
result = FMOD_System_Create(system)
result = FMOD_System_GetVersion(system, version)
result = FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, 0)
result = FMOD_System_CreateSound(system, “wave.wma”, (FMOD_CREATESTREAM Or FMOD_SOFTWARE), exinfo, Sound)
result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, Sound, 0, channel)
End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim result As FMOD_RESULT
If Sound Then
result = FMOD_Sound_Release(Sound)
End If
If system Then
result = FMOD_System_Close(system)
result = FMOD_System_Release(system)
End If
End Sub

Private Sub Timer2_Timer()
Dim x1 As Single
Dim x2 As Single
Dim y1 As Single
Dim y2 As Single
Dim SpecArr(512) As Single
Dim i As Long
Dim result As FMOD_RESULT

result = FMOD_Channel_GetSpectrum(channel, SpecArr(0), 512, 0, FMOD_DSP_FFT_WINDOW_MAX)
While i < 512
x1 = Picture1.ScaleWidth * (i / Picture1.ScaleWidth)
y1 = Picture1.ScaleHeight – Picture1.ScaleHeight * (SpecArr(i) * 10)
x2 = Picture1.ScaleWidth * (i / Picture1.ScaleWidth)
y2 = 0
Picture1.Line (x1, y1)-(x2, y2), vbBlack

x1 = Picture1.ScaleWidth * (i / Picture1.ScaleWidth)
y1 = Picture1.ScaleHeight * (1 – SpecArr(i) * 10)
x2 = Picture1.ScaleWidth * (i / Picture1.ScaleWidth)
y2 = Picture1.ScaleHeight
Picture1.Line (x1, y1)-(x2, y2), &HFF8080
i = i + 3
Wend

End Sub

please, print upgrades and recommendation

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.