Using WMP control, volume changes main app volume

会有一股神秘感。 提交于 2019-12-13 02:25:48

问题


Using the following WMP control code,

public static WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer();
...

And volume controls,

private void button4_Click(object sender, RoutedEventArgs e)
    {
        if (player.settings.volume > 0)
        {
            player.settings.volume--;
        }
        TextBox3.Text = "Music Volume: " + player.settings.volume.ToString();
    }

It's basically a kind of computer karaoke, where the computer uses text to speech to 'sing' the lyrics, and wmp to play the instrumental. Unfortunately, I have a problem because when I set the WMP Control's volume it adjusts the whole app's volume, whereas setting the text-to-speech object's volume does not affect WMP's volume. Is there a way to play an mp3 so ideally both volumes are completely independent of each other?

来源:https://stackoverflow.com/questions/24248115/using-wmp-control-volume-changes-main-app-volume

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!