开发者

Detect if speakers are plugged in?

开发者 https://www.devze.com 2023-02-03 08:43 出处:网络
Is there any way to detect if computer has speakers plugged in? It would be nice if that would be possible with J开发者_StackOverflowavaScript, but if not, then my best bet would be Java.

Is there any way to detect if computer has speakers plugged in? It would be nice if that would be possible with J开发者_StackOverflowavaScript, but if not, then my best bet would be Java.

But, yeah, I haven't worked with Java at all, any useful resources on this?

Thanks in advance!

EDIT:

So the answer for this is "impossible" and I shouldn't even bother looking for a solution?


Every piece of software I've seen that needs to determine such a thing provides a way for the user to play a "test sound" and give the application some appropriate feedback. That seems to be the most practical solution.


The computer itself is not, in general, aware of this.
Some audio drivers are, but they don't expose the information.

0

精彩评论

暂无评论...
验证码 换一张
取 消