控制 Windows 音量

发布于 2024-08-05 23:57:39 字数 290 浏览 7 评论 0原文

我们的软件应该播放声音(不仅仅是小噪音,还包括语音等)。我想知道音量控制怎么样。 Windows Vista 风格指南要求在 Windows 混音器中定义应用程序特定的音量控制。

但是 Windows XP 及以下版本呢?我认为没有办法让我们控制 Windows 混音器。但是您可以实现自己的音量控制,但如果您不修改音频数据,它就不能比系统范围的音量更大(可能非常低甚至静音)。

问题是:应用程序应该使用它自己的音量控制还是触发 Windows 音量控制?

问题是,基本用户甚至不知道在 Windows 中哪里设置卷。

Our software should play sounds (not just small noises, but voice etc.). I wonder what about the volume control. The Windows Vista style guide lines says to define an application specific volume control in the Windows mixer.

But what about Windows XP and below? I don't think there is a way to get our control into the Windows mixer. BUT you can implement your own volume control, but if you don't modify the audio data, it cannot go louder than system wide volume (which might be very low or even mute).

The question is: should an application use it's own volume control or trigger the Windows volume control?

The problem is, that basic user doesn't even know where to setup the volume in Windows.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我不是你的备胎 2024-08-12 23:57:39

大多数音频渲染框架(您没有提及您使用哪一个)允许用户控制从音频渲染框架传递到系统音频引擎的流的音频。例如,DirectSound 有一个方法 IDirectSoundBuffer,允许您设置该声音缓冲区的音量。

对于客户来说,每个应用程序的音量控制(无论是否通过系统混音器公开)比控制主音量的应用程序要好得多。许多机器(例如大多数当前的笔记本电脑)不提供硬件音量控制,而是依赖用户将主音量设置为舒适的水平(这是高度用户特定的值)。如果您的应用程序操纵主音量,您将覆盖用户的选择,他们可能会感到不安。

顺便说一句,需要明确的是:我对 MusiGenesis 的选择也没有意见。对于他的应用程序的特殊示例,这种选择是有意义的。另一个与 MusiGenesis 示例类似的示例是 MIDI 渲染应用程序。如果应用程序有时通过硬件 MIDI(不带音量控制)渲染,有时通过软件 MIDI(带音量控制)渲染,则不向用户公开音量控制以避免混淆可能是有意义的。

Most audio rendering frameworks (you don't mention which one you use) allow the user to control the audio of the stream passed from the audio rendering framework to the system audio engine. For example, DirectSound has a method IDirectSoundBuffer that allows you to set the volume for that sound buffer.

Per-application volume control (whether it's exposed via the system mixer or not) is a dramatically better experience for customers than an application controlling the master volume. Many machines (most current laptops for example) don't provide hardware volume controls and depend on the user to set the master volume to a comfortable level (which is a highly user specific value). If your application manipulates the master volume you're overriding the user choice and they're likely to be upset.

Btw, to be clear: I have no issues with MusiGenesis' choices either. For the specialized example of his application, that choice makes sense. Another similar example to MusiGenesis' example is a MIDI rendering application. If the application sometimes renders through hardware MIDI (with no volume control) and sometimes through software MIDI (with a volume control) it may make sense not to expose the volume control to the user to avoid confusion.

凌乱心跳 2024-08-12 23:57:39

在我的应用程序(软件合成器/音乐创作工具)中,我实际上没有触及系统音量,甚至没有为我自己的应用程序提供音量控制。我的所有音频输出都标准化为最大可能级别的 95% 左右,从那时起,用户可以使用 Windows 音量控制或扬声器上的音量控制来控制输出音量。

在我看来,这就是像这样的 Windows 音频应用程序应该的行为方式,因为通常在使用软件合成器时,它是唯一产生音频输出的应用程序,并且用户已经还有另外两种控制音量的方式(Windows 控件和扬声器旋钮)。

对于像您这样的应用程序,其目的是在其他应用程序也可能发出噪音的环境中播放声音,我认为您的应用程序应该只提供一种降低自身音量的方法,而不影响系统音量。大多数 Windows 用户已经知道系统音量控件在哪里(右下工具箱),因此将此控件添加到您自己的应用程序中也是多余的。

In my application (a software synthesizer/music composition tool) I actually don't touch the system volume or even offer a volume control for my own application. All my audio output is normalized to about 95% of the max possible level, and from that point the user can control the output volume either with the Windows volume control or the volume control on their speakers.

In my opinion, this is how a Windows audio application like this should behave, because typically when a software synthesizer is used it's the only application producing audio output, and the user already has two other ways of controlling volume (the Windows control and the speaker knob).

In the case of an application like yours, which is meant to play sounds in an environment where other applications may be making noise also, I think your application should only offer a way of lowering its own volume, without affecting the system volume. Most Windows users already know where the system volume control is (lower right toolbox), so it's kind of superfluous to add this control to your own application as well.

宁愿没拥抱 2024-08-12 23:57:39

我们的应用程序还需要输出语音,并且相对于可能同时运行的其他应用程序也具有不同的音量设置。我们有一个音量控制,用户可以在应用程序内更改。

因此,在 Windows 2000/XP 中,我们会在应用程序获得焦点时修改系统音量,并在失去焦点或应用程序关闭时将其设置回之前的设置。这确实工作得很好,并且似乎不会干扰同时运行的其他基于音频的应用程序的工作(例如对录音音量非常敏感的语音识别软件)。

这与 Vista 和 Windows 7 的行为完全相同,只是它们负责维护每个应用程序的单独音量级别(在这种情况下,我们禁用前面提到的代码)。

Our application needs to output voice as well, and also have different volume settings relative to other applications that may be running at the same time. We have a volume control that the user can change from within the application.

As such, in Windows 2000/XP, we do modify the system volume when our application gains focus, and set it back to the previous setting when we lose focus or when then application shuts down. This does work well, and does not seem to interfere with the workings of other audio based applications running at the same time (such as speech recognition software which is very sensitive to recording volume for example).

This is exactly the same behaviour as Vista and Windows 7, except that they do the work of maintaining the individual volume levels for each application (and in this case we disable the previously mentioned code).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文