Search code examples
delphiwindows-7media-playervolume

how to get maximum volume level in delphi?


I try Get and Set the MediaPlayer Sound Volume by http://delphi.about.com/od/adptips2006/qt/mediaplayer_vol.htm

but 1000 is not full sound volume. how to get Maximum volume level?


Solution

  • The MCI interface does not specify a maximum value for the volume.

    The mciSendCommand API function expects a factor for the given parameters. In MCI terms factors are scaled with 1000:

     500 = 0.5 // 50%, half the normal value
    1000 = 1.0 // 100%, normal value
    2000 = 2.0 // 200%, double the normal value
    

    (What that factor actually means depends on the specific API function)

    In your case 1000 means 100% volume, all smaller values are setting an attenuation. Of course the actual audio driver behind the MCI interface can also accept amplifications, i.e. values > 1000.

    Using a value of 1000 as the maximum seems to be a safe choice.

    If you are about to create some kind of multimedia application you should seriously consider a more current interface or library. (Personally I've had good experiences with FMOD and Delphi)