简体   繁体   English

如何在Javasound中选择麦克风?

[英]How to select a microphone in Javasound?

How does Javasound handle multiple microphones? Javasound如何处理多个麦克风? Is it possible to select one of multiple microphones? 是否可以选择多个麦克风中的一个? How does one determine which microphone is being used? 如何确定使用哪个麦克风? Is the input of multiple microphones even handled by the Java Virtual Machine? 多个麦克风的输入是否由Java虚拟机处理? Finally, is this method standardized across operating systems or does the OS affect what the JVM hears. 最后,这种方法是跨操作系统标准化的,还是操作系统会影响JVM听到的内容。 Here is the code I am currently using to generate a TargetDataLine from the microphone. 这是我目前用于从麦克风生成TargetDataLine的代码。

DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, getAudioFormat());
setTargetDataLine((TargetDataLine) AudioSystem.getLine(dataLineInfo));

I believe separating out various microphone inputs depends on whether or not these mikes are exposed to Java via their own lines or ports. 我相信分离各种麦克风输入取决于这些麦克风是否通过自己的线路或端口暴露给Java。

The tutorial section named Accessing Audio System Resources will provide you with the means of identifying what Java is able to "see." 名为Accessing Audio System Resources的教程部分将为您提供识别Java能够“看到”的方法。 It is the first main section after the overview intro. 这是概述介绍之后的第一个主要部分。 If you list the info for each, hopefully you will be able to identify each mike line (assuming your sound card and OS are configured to allow this). 如果您列出每个的信息,希望您能够识别每个麦克风线(假设您的声卡和操作系统配置为允许此操作)。

Agreed, the Audio tutorial is one of the most difficult! 同意,音频教程是最难的之一! In part, this is because audio IS difficult, complicated by the various OS's that it must run on as well as intervening hardware and software. 在某种程度上,这是因为音频难以通过必须运行的各种操作系统以及介入的硬件和软件来复杂化。 Different sound card and OS combinations can work in different ways. 不同的声卡和OS组合可以以不同的方式工作。 At some stage they have to expose lines or ports to Java. 在某些阶段,他们必须将行或端口暴露给Java。 I'm not aware of any multiplexing systems (two or more mikes somehow sharing a single line or port). 我不知道任何多路复用系统(两个或多个麦克风以某种方式共享一条线路或端口)。 I'm also not clear on whether it is the lines or ports that you need to focus on. 我也不清楚你需要关注的是线路还是端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM