【问题标题】:DirectSound: setting the volume to a percentageDirectSound:将音量设置为百分比
【发布时间】:2011-02-20 17:25:22
【问题描述】:

SecondaryBuffer 类中的 Volume-Property 似乎很奇怪,因为 -4000 左右的值是 0%,而 0 是 100%,如何将 Volume 设置为精确的百分比或获取最低的 Volume 来做到这一点我自己?

【问题讨论】:

    标签: c# directx directsound


    【解决方案1】:

    假设您的百分比是 0 和 1 之间的两倍,并命名为 volumePercentage:

    double adjustedVolume = (1d - volumePercentage) * -4000d;
    

    【讨论】:

      猜你喜欢
      • 2013-01-22
      • 1970-01-01
      • 1970-01-01
      • 2013-03-12
      • 2011-01-08
      • 2018-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多