gpt4 book ai didi

c# - 在Windows Mobile 6上使用SndPlayAsync功能时控制音量

转载 作者:行者123 更新时间:2023-12-02 23:01:00 27 4
gpt4 key购买 nike

您究竟如何控制Windows Mobile 6上使用SndPlayAsync播放的声音的音量?

似乎没人知道!该文档没有提及任何相关内容...
因此,要么没有办法,要么将其保密。

此外,我知道可以使用Windows Media Player,但如果可能的话,我宁愿不使用。

谢谢你的帮助!

阿维夫

最佳答案

我的建议是:

[DllImport("coredll.dll", SetLastError = true)]
protected static extern int waveOutSetVolume(IntPtr device, uint volume);

[DllImport("coredll.dll", SetLastError = true)]
internal static extern int waveOutGetVolume(IntPtr device, ref int volume);

然后您可以调用方法:
int before;
uint maxVol = uint.MaxValue;
waveOutGetVolume(IntPtr.Zero, ref before);
waveOutSetVolume(IntPtr.Zero, maxVol);
//Do some playing
waveOutSetVolume(IntPtr.Zero, before);

您可以调试其他值。这会将其设置为最高。

希望能帮助到你?

关于c# - 在Windows Mobile 6上使用SndPlayAsync功能时控制音量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1548491/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com