Java Sound API to access the system/master volume control in Vista and Win 7

前端 未结 2 1248
旧时难觅i
旧时难觅i 2020-12-06 16:05

History & Situation:

I\'m currently working on updating a Java application that was developed for a client several years ago (to run on WinXP) a

相关标签:
2条回答
  • 2020-12-06 16:17

    If you run your application in Windows XP compatibility mode, it should work (it depends on how the Java Sound API interacts with the hardware volume).

    If you want to use the Vista (and beyond) sound APIs, you want to look at the IAudioEndpointVolume API.

    0 讨论(0)
  • 2020-12-06 16:20

    My guess is since you're using an USB device, your Java sound API does not access the correct channel.

    You can have a look at how to adjust the master volume in Windows XP. I know you aren't working in XP but have a look at how to access specific Lines and Mixers on that link. You may have to experiment a bit to find the correct line and mixer combination, or offer your users a GUI that allows them to choose the correct line and mixer combination.

    I've run applications that work with this method in Windows 7 so I doubt that it's an O compatibility issue.

    0 讨论(0)
提交回复
热议问题