LonelyViper

Audio Device Cmdlet - Volume

Nov 5th, 2023
1,186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # this will be communication microphone - Microphone (2- Beyond)
  2.  
  3. $AudioDevice_D = "{0.0.0.00000000}.{9331b5d7-a071-46de-9b09-3e44f28e9fea}"
  4.  
  5. # set default communication recording device
  6.  
  7. $DefaultRecordingComm = Get-AudioDevice -RecordingCommunication
  8. If ($DefaultRecordingComm.ID -ne $AudioDevice_D) {Set-AudioDevice -ID $AudioDevice_D -CommunicationOnly | Out-Null}
  9. Else {Set-AudioDevice -ID $AudioDevice_D | Out-Null}
  10.  
  11. # set the volume for the default communication recording device to 65
  12. Set-AudioDevice -RecordingCommunicationVolume 65
  13.  
  14.  
  15. # Play sound (unchanged)
  16. $Sound = new-Object System.Media.SoundPlayer
  17. $Sound.SoundLocation = "c:\WINDOWS\Media\Windows Background.wav"
  18. $Sound.Play()
  19. Start-Sleep -s 3
Tags: VR
Advertisement
Add Comment
Please, Sign In to add comment