|
-
Apr 21st, 2000, 04:30 PM
#1
Thread Starter
Fanatic Member
Does anyone know how to make spectrum analyzer for audio player. I tried a lot but could make only a audio level indacator using a single bar of bitmap and clip control of VB. please help me if anyone knows it.
Thanks.
-
Apr 22nd, 2000, 07:50 AM
#2
Do you know about time domain, frequency domain, and FFT's (Fast Fourier Transforms)? The "spectrum" is frequency information.
Send me your code.
[email protected]
-
Apr 22nd, 2000, 11:47 AM
#3
Thread Starter
Fanatic Member
Ya, I know about time domain frequency domain etc and also know that spectrum is plotted on frequency domain. Do you know how to do that and make a good spectrum lik that of JET Audio
-
Apr 22nd, 2000, 03:19 PM
#4
Thread Starter
Fanatic Member
I have written my program using the utorials on Audio Level Indicator available at Microsoft's website. In that they have used progress bar to indicate audio level bu i have modified it and used the Picture Clip Control to show the audio level. The picture is a bitmap on which i've drawn around 42 bars which shows different levels and depending upon the value of audio level, the corresponding bitmap is clipped and displayed in a picture box. Thus is looks like LED's moving up and down.
-
Apr 22nd, 2000, 05:04 PM
#5
Lively Member
Where can I find this nice tutorial on Microsoft ?
Please tell me.
-
Apr 22nd, 2000, 06:58 PM
#6
Thread Starter
Fanatic Member
Goto microsoft.com's programmers section. In that goto visual basic downloads. there you'll find the audio level example. I don't remember the page url.
-
Apr 23rd, 2000, 01:51 AM
#7
transcendental analytic
Bah! There was no resolution in this volume sample!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 23rd, 2000, 02:19 AM
#8
Thread Starter
Fanatic Member
I told you that i had modified that code to produce a good looking audio level indicator using bitmaps looking like LED's.
If you want to do so make a bitmap containing as many bars as you want starting form bar one showing only one LEd glowing and the last bar showing all LED's glowing. Paint it in green or so. Now use a Picture Clip control on your form (project refrences) now add a picture box to the form and also the bitmap tht you have prepared. Set the followng properties of the clipcontrol in the form load sub. in the same project of Microsoft. Remove the code for progress bar, but not the entire code!(clpBar is the name of my picture clip control, imgGreen is the name of the bitmap.)
Dim a As Long
Private sub Form_Load()
clpBar.Cols = 42
clpBar = imgGreen
Timer1.Interval = 80
Image1.visible= False
End sub
Private Sub Timer1_Timer()
On Error Resume Next
' Get the current output level
mxcd.dwControlID = outputVolCtrl.dwControlID
mxcd.item = outputVolCtrl.cMultipleItems
rc = mixerGetControlDetails(hmixer,mxcd,MIXER_GETCONTROLDETAILSF_VALUE)
CopyStructFromPtr volume, mxcd.paDetails, Len(volume)
If volume = 0 Then
a = 0
Else
a = Log(volume) * 3 ' (I have just written this formula on trial and error basis for smooth animation)
End If
If a > 41 Then a = 41 'Since my bitmap has 41 vertical bars
picBar1 = clpBar.GraphicCell(a)
End sub
I hope this will help you. Note that the distance between the bars in bitmap should be equal or you'll not get proper animation.
Good Luck.
Kinjal.
I had asked for a tutorial on spectrum analyzer and now someone is asking me to give tutorial on audio level indiator. Ha ha ha.... Never mind!
-
Apr 23rd, 2000, 02:44 AM
#9
transcendental analytic
Sorry didn't have time to check your sample, heres mine:
I removed all controls except the timer and added the amplitude function., This one will show that the resolutions is too bad.
[code]
Private Sub Timer1_Timer()
Dim pos As Integer
On Error Resume Next
Do
DoEvents
Caption = Amplitude
pos = pos + 1: If pos > ScaleWidth Then pos = 0: Cls
Line (pos, 0)-(pos, Amplitude)
Loop
End Sub
Private Function Amplitude() As Long
mxcd.dwControlID = outputVolCtrl.dwControlID
mxcd.item = outputVolCtrl.cMultipleItems
rc = mixerGetControlDetails(hmixer, mxcd, MIXER_GETCONTROLDETAILSF_VALUE)
CopyStructFromPtr volume, mxcd.paDetails, Len(volume)
Amplitude = volume
End Function
[code]
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 15th, 2004, 04:31 AM
#10
New Member
I have a code of a VB Oscilloscope using sound card and modified it for my VB Temperature sensor but it's kinda slow....
I need a VU meter that returns an integer value... for my temperature control system....
Where can i find it in microsoft? Does it return Values?
-
Jul 15th, 2004, 04:51 AM
#11
New Member
Could not get wave in meter...
I've got the code from microsoft but it didnt work! it returns an error Msgbox "Could not get wave in meter" & Could not get wave out meter! I dont know where is the error... i am using win Xp proffessional!
Can anybody help me?
I need it for my Temperature monitor... using sound card...
A sample code would be great...
-
Jul 15th, 2004, 09:56 AM
#12
Fanatic Member
You should probably make a new thread, seeing as this one is over four years old...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|