locked
How to set volume to X value RRS feed

  • Question

  • Hi,

    I would like to ask how can I set the windows volume to X value? let's say I want to set it to 50?

    Thanks,

    jassim

    Tuesday, April 26, 2016 8:01 AM

Answers

  • Hi Jassim,

    Do you check the following warning?

    WARNING

    Due to the use of fixed-sized ints and field offsets, this may fail fantastically on 64-bit Windows.  I don't know, I haven't tested it and haven't paid enough attention to know if these field sizes expand to 64 bits.  caveat codor

    In addition, please make sure your Prefer32-bit is checked. This build error will be gone.

    But because my machine is win8 64 bit, as the warning says, this method fail fantastically on 64-bit windows.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Kristin Xie Wednesday, April 27, 2016 3:11 AM
    • Proposed as answer by DotNet Wang Monday, May 2, 2016 9:17 AM
    • Marked as answer by DotNet Wang Friday, May 6, 2016 1:52 AM
    Wednesday, April 27, 2016 3:09 AM

All replies

  • Hi,

    I used this code :

    Changing master volume level

    The code is huge but it's the translation from C++.

    It's works fine for me.

    Regards

    Cedric

    Tuesday, April 26, 2016 12:28 PM
  • I am getting:

    Could not load type 'MetricsInfo' from assembly 'Sound Play, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it contains an object field at offset 4 that is incorrectly aligned or overlapped by a non-object field.
    


    on this line:

    MixerInfo mi = GetMixerControls();

    Tuesday, April 26, 2016 2:55 PM
  • Hi Jassim,

    Do you check the following warning?

    WARNING

    Due to the use of fixed-sized ints and field offsets, this may fail fantastically on 64-bit Windows.  I don't know, I haven't tested it and haven't paid enough attention to know if these field sizes expand to 64 bits.  caveat codor

    In addition, please make sure your Prefer32-bit is checked. This build error will be gone.

    But because my machine is win8 64 bit, as the warning says, this method fail fantastically on 64-bit windows.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Kristin Xie Wednesday, April 27, 2016 3:11 AM
    • Proposed as answer by DotNet Wang Monday, May 2, 2016 9:17 AM
    • Marked as answer by DotNet Wang Friday, May 6, 2016 1:52 AM
    Wednesday, April 27, 2016 3:09 AM