Page 5 of 5 FirstFirst 12345
Results 41 to 48 of 48

Thread: New MP3 Car Software in VB6

  1. #41
    Variable Bitrate
    Join Date
    Dec 2001
    Location
    Paignton, Devon, UK
    Posts
    315
    I'm having loads of fun with interfacing with winamp - got everything sorted apart from one little glitch which i think can't be solved

    I checked the nullsoft developers forum and everyone says it can't be done. Just in case anyone knows a miracle cure, is there any way to determine winamp's current volume or balance level? If so, anyone know how to do it in vb??

    It aint really important, just for niceties. It took me long enough to work out how to read titles from the playlist but now I've got that sorted it would be a shame to give up on this little thing. I'm probably gonna just set the volume to 100% on startup but it would be nicer to properly read the volume control's current position. Also, anyone played with interfacing winamp 3 and vb - i'm guessing that this isn't exactly possible or practical due to its current beta state?

    Cheers

    Andrew
    Mediabox Hardware Project
    Current Stage: A complete redesign, although not much happening right now!

    Mediabox Software Project
    Status: Writing Sync Software (still) and playing around with interface
    To do: Far too much!

  2. #42
    FLAC Gutter's Avatar
    Join Date
    Dec 1999
    Location
    Casina, Italy
    Posts
    901
    If you're using VB, download the module that they have on their developer's page. It has way to turn its volume up and down.

    WinAMP_VolumeUp 255 or something like that. I didn't like using Winamp's volume control when I wrote my software. If you slide it down slowly, you see it stays loud 3/4 down the way until you get near the left and cuts out really fast. I finally just controlled the main volume for the whole system which works much better. In your software, tell Winamp to turn its volume all the way up, then just manipulate the main volume. I think you'll be much happier.

  3. #43
    Variable Bitrate
    Join Date
    Dec 2001
    Location
    Paignton, Devon, UK
    Posts
    315
    Yep I'm doing that without a problem. However it appears that the volume level cannot be determined, only set. This appears to be a winamp2 bug - i have got bitrate, sample rate and virtually every other setting from winamp apart from balance and volume

    I'm also working on a way to autodetect winamps install directory from the uninstall string. It's a shame that winamp doesn't actually make an install registry string apart from the uninstall though - it would make my life easier! If anyone knows a better way to do this, let me know! Cheers.

    Andrew
    Mediabox Hardware Project
    Current Stage: A complete redesign, although not much happening right now!

    Mediabox Software Project
    Status: Writing Sync Software (still) and playing around with interface
    To do: Far too much!

  4. #44
    FLAC Gutter's Avatar
    Join Date
    Dec 1999
    Location
    Casina, Italy
    Posts
    901
    Originally posted by Andrew Chappell
    Yep I'm doing that without a problem. However it appears that the volume level cannot be determined, only set.
    Are you anticipating that the user will change the volume manually? If not, just keep set the volume when it starts up and keep that number in a variable which you can check on later.

    You can check the current volume if you control the main volume setting.

    Sorry if I'm still not getting it.

  5. #45
    Variable Bitrate
    Join Date
    Dec 2001
    Location
    Paignton, Devon, UK
    Posts
    315
    I was gonna cheat and use a generic ir plugin for winamp which varies the winamp volume level. My program would then not need to bother with ir support till later Ahh well i don't think this is possible through system messaging. If i can be bothered, perhaps i'll find a way to do it through plugins...

    Cheers

    Andrew
    Mediabox Hardware Project
    Current Stage: A complete redesign, although not much happening right now!

    Mediabox Software Project
    Status: Writing Sync Software (still) and playing around with interface
    To do: Far too much!

  6. #46
    FLAC
    Join Date
    Apr 2001
    Location
    Here, There, Everywhere
    Posts
    1,436
    like gutter said, just use a variable to hold the current volume, thats what I did.... its true to that the volume drops off really quickly - I solved it by adding an option to my softwares INI file.. it goes like this...


    6,10,11,14,25,45,60,75 , etc...

    those aint the values BTW..... but the software reads it in as an array and uses them as the 'volume steps'.... that way I could tweak the steps array to give better control of the volume at lower levels......

    I have it set so the volume steps are smaller at the lower end to give me better low volume control and bigger at the 'loud' end... basically if my 10inch subs are shakin my rear hatch off its hinges, I dont need my next volume UP step to be a small one - its pretty obvious I want it dammm loud by that point..!!!!

    make sense?

    U wanted the IRman code for VB I wrote didnt u? sorry I have been flat out and forgot (sadly mp3car cant consume 100% of my work day! ) Do u still want me to forward it thru? It will solve your IRman trubbles real easy.... only about 20-30 lines of tight VB code...
    Project - GAME OVER :(

  7. #47
    Variable Bitrate
    Join Date
    Dec 2001
    Location
    Paignton, Devon, UK
    Posts
    315
    Yeah that ir code would be cool! Cheers

    The thing i really wanted to do was read winamp's current volume and set the volume slider in my interface to the same level, but it appears there is not a system message to retrieve this, according to the winamp site. Looks like i'll just use the main windows volume control - it looks much easier!

    Cheers

    Andrew
    Mediabox Hardware Project
    Current Stage: A complete redesign, although not much happening right now!

    Mediabox Software Project
    Status: Writing Sync Software (still) and playing around with interface
    To do: Far too much!

  8. #48
    Maximum Bitrate starfox's Avatar
    Join Date
    May 2002
    Location
    Australia
    Posts
    451
    If you want to get the volume, use the waveOutGetVolume. Here's some code from my app:

    Public Function GetWaveVolume(ByVal nMin As Long, ByVal nMax As Long) As Long

    Dim nVol As Long, nLeft As Long, nRight As Long

    waveOutGetVolume ByVal 0&, nVol

    nLeft = nVol And &HFFFF&
    nRight = (nVol And &HFFFF0000) \ &H10000

    If nLeft <> nRight Then
    MsgBox "Wave vol balance isn't equal!"
    Else
    GetWaveVolume = nMin + ((nLeft / &HFFFF&) * (nMax - nMin))
    End If

    End Function


    You can pass HWAVEOUT as 0& to ask for the default device, and unless you have two sound cards and you've told Winamp to ouput to something besides the wave mapper, that should be what you want.

    Also i'm assuming that nLeft and nRight are the same here... nMin and nMax are the lower and upper bounds of your returned variable, so for winamp call it like:

    nMyVol = GetWaveVolume (0, 255)

    and you'll get a value between 0 and 255 which is what winamp uses.

    Nb. in the line nLeft = nVol And &HFFFF&, you don't forget the ampersand on the end! If you try to And nVol with &HFFFF, it'll assume you want to use a 16 bit variable, and you might get a negative value because VB doesn't support unsigned data types.

    Also, the above code only works if you have the balance set to the center... I don't know what would happen to Winamp's values if you changed the balance, as it would change the left and right volumes!

Page 5 of 5 FirstFirst 12345

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •