静音/取消静音应用程序声音 [英] Mute/Unmute Application Sounds
本文介绍了静音/取消静音应用程序声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用的代码是:
My.Computer.Audio.Play(My.Resources.audio_here, AudioPlayMode.Background)
推荐答案
查看 winmm.dll 中的 waveOutSetVolume
和 waveOutGetVolume
函数
Take a look at the waveOutSetVolume
and waveOutGetVolume
functions in winmm.dll
Private Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByVal dwVolume As Integer) As Integer
Private Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByRef lpdwVolume As Integer) As Integer
根据目标机器的操作系统版本,您可能需要考虑使用较新的 MMDevice
和 EndpointVolume
API.
Depending on the OS version of your target machines, you may need to look into using the newer MMDevice
and EndpointVolume
APIs.
这篇关于静音/取消静音应用程序声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文