PDA

View Full Version : Get Winamp Volume


mr_biscuit
12th February 2003, 10:01
Unfortunately there is no api that will return the current volume of winamp. I have managed to find a way (it is messy) but it does return the volume.

What you have to do is extract the volume from the winamp ini file. The only problem is that this value is not current - it is the volume that was set when the user last exited winamp (and therefore triggered the ini file to be written).

What I have done is to refresh the volume when winamp is idle (i.e. not playing!) by restarting winamp and hence updating the ini file. I can then extract the volume which is now as up2date as possible.

I told you this is messy but its the only way I can find to retrieve the volume. If anyone knows of a way to update the ini file in any other way other than restarting winamp, please let me know!

Mr Biscuit

princeofdrkness
12th February 2003, 16:35
I was just looking at a component that allows you to control winamp...called mp3remote and it has no problem reading/setting the volume so there must be a way to do it.

The control iz here:

http://www.mindblastsoftware.com/index.html?page=mp3remote

It does not seem to work with winamp 3 though so you'll have to use the earlier versions.

princeofdrkness
12th February 2003, 16:39
I'm sorry I made a mistake the above component does not tell u the volume level it just let's u adjust the volume. Sorry for the mistake.

jmoschetti45
17th February 2003, 22:28
You can get the current volume from winamp.
I can do it in VB. I just have to find my code sheet so hold on.

jmoschetti45
17th February 2003, 22:31
Sub WinAMP_GetVolume(VolumeValue As Long)
If hwndWinamp = 0 Then
MsgBox "WinAMP window not found yet...", vbOKOnly + vbCritical, "WinAMP Not Found"
Exit Sub
End If
If VolumeValue < 0 Or VolumeValue > 255 Then
Exit Sub
End If
SendMessage hwndWinamp, WM_USER, VolumeValue, WA_GETVOLUME
End Sub

marianosc
18th February 2003, 11:24
jmoschetti45, that is for Winamp 2 ... how can you get the volume in Winamp3?

jmoschetti45
18th February 2003, 23:43
sorry but with that I can't help you much because all I can do in 3.x is play, pause, ect. Nothing complex yet.