+ Reply to Thread
Results 1 to 5 of 5

Adjusting master volume

  1. #1
    Registered User
    Join Date
    07-03-2007
    Location
    Canberra, Australia
    MS-Off Ver
    2010
    Posts
    60

    Adjusting master volume

    Hi,

    I have searched this and other forums and I am unable to find any code that works correctly, I am trying to detect if the users volume is set to mute and if it is I want it to turn the sound on. I also need to adjust the volume levels.

    I have found this code that toggles the mute on/off but I need to detect if it is already muted

    Please Login or Register  to view this content.
    I know it has something to do with API's but I am not sure how to access these

    Thanks for your help
    Kerno

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning Kerno

    There's a piece of code here from KeepITCool which seems to work like a treat. Copy it into an empty module, and use this formula to call it :
    =GetMasterMuteState()

    http://www.pcreview.co.uk/forums/thread-1008148.php

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    07-03-2007
    Location
    Canberra, Australia
    MS-Off Ver
    2010
    Posts
    60
    Hi dominicb,

    Thanks for your reply, the code to adjust the volume up or down works great but I cannot seem to get the code to check the mute state,
    I copied the function
    Please Login or Register  to view this content.
    to a module and used
    Please Login or Register  to view this content.
    to call the function but i get a series of compile errors stating
    'User defined type not defined' for the following

    Dim mxc As MIXERCONTROL
    Dim mxl As MIXERLINE
    Dim mxlc As MIXERLINECONTROLS
    Dim mxcd As MIXERCONTROLDETAILS
    Dim mxcdMute As MIXERCONTROLDETAILS_BOOLEAN

    do I need to add any additional 'References' to accept the MIXER types above

    Thanks for your time

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning Kerno

    No, you don't need need to check any references, but you do need all the additional code that comes before the actual function. Thiis states all the constants that are required and cals the APIs to find them. Here, with all due credit to KeepITCool, is the code from this thread :

    http://www.pcreview.co.uk/forums/thread-1008148.php

    Please Login or Register  to view this content.
    Use this to call it from VBA, which will return the boolean value of TRUE / FALSE.

    Please Login or Register  to view this content.
    HTH

    DominicB

  5. #5
    Registered User
    Join Date
    07-03-2007
    Location
    Canberra, Australia
    MS-Off Ver
    2010
    Posts
    60
    Hi dominicb,

    Thanks for your reply the code works great, again thanks for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1