WMFP.SetVolume
--------------

Sets the audio volume.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WMFP](component_WMFP.md) | [10.0](newinversion100.md) | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |

MBS( "WMFP.SetVolume"; Player; Volume ) 

**MBS**( **"WMFP.SetVolume";** /\* Sets the audio volume. \*/  
**$Player**; /\* The reference number for the Windows Media Foundation Player object.e.g. $$Player \*/   
**$Volume**) /\* The new volume value. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Player | The reference number for the Windows Media Foundation Player object. | $$Player |
| Volume | The new volume value. |  |

### Result

Returns OK or error.

### Description

Sets the audio volume.  
Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation).  
If you call this method before playback starts, the setting is applied after playback starts.  
### Examples

Set to volume to 50%:

 Set Variable \[$r ; Value: MBS ( "WMFP.SetVolume"; $$Player ; 0.5 ) \]  
### See also

- [WMFP.GetVolume](WMFPGetVolume.md)

This function checks for a license.

Created 25th December 2019 , last changed 17th July 2022

  
[WMFP.SetVisible](WMFPSetVisible.md) - [WMFP.Stop](WMFPStop.md)

[HTML Version](WMFPSetVolume.shtml)