如何在Java中对多通道声音输入进行采样

发布于 2024-07-10 20:06:51 字数 365 浏览 8 评论 0原文

我意识到这可能是相对小众的,但这也许就是为什么无论如何都要问这个问题。 我正在寻找一个硬件多输入录音控制台(例如 Alesis IO 26)来接收 Adat 光管 8 通道输入来进行信号处理。 由于我还没有获得该设备,并且需要弄清楚这是否可行(预算问题),我想请问是否有人有在Java中利用所有这8个输入来获取数据的经验? 我见过大量使用 Javax.sound.sampled 库录制声音的示例,但我找不到任何有关超过 2 个多声道的信息。我感兴趣的是对 8 个声道单独采样作为单声道源对它们执行一些简单的DSP。 硬件设备是否会被视为一台混音器? 8 个通道可以表示为 8 条线吗? 我希望我的术语是正确的。

如果有人能给我指出任何相关信息,我将不胜感激。 谢谢!

I realised this might be relatively niche, but maybe that's why this is good to ask anyway. I'm looking at a hardware multiple input recording console (such as the Alesis IO 26) to take in an Adat lightpipe 8 channel input to do signal processing. As I have yet to acquire the device and need to work out whether this is feasible (budgetary concerns), I'd like to ask if anyone has any experience tapping all these 8 inputs for data in Java? I've seen tons of examples of recording sound using the Javax.sound.sampled libraries but I couldn't find any information on multichannel that is more than 2. What I'm interested in is sampling the 8 channels individual as mono source to perform some simple DSP on them. Would the hardware device be treated as one mixer? And the 8 channels be represented as 8 lines? I hope I got my terminology right.

I would appreciate if someone can point me to any relevant information. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

抹茶夏天i‖ 2024-07-17 20:06:51

多声道音频在 Java 中应该是可能的,具体取决于您运行的 Java 版本、运行的平台以及运行的声卡类型。 有关更多详细信息,请参阅优秀的 Java 音频常见问题解答。 我从未能够在所有平台上可靠地使用它。

如果您真的关心制作强大的多通道音频,我建议使用 C API,例如 PortAudio、< a href="http://www.rawmaterialsoftware.com/juce/" rel="nofollow noreferrer">Juce,或 PulseAudio

我在 PortAudio 和 Juce 上都非常幸运。

要在 Java 中使用这些,您需要为 C API 创建一个 JNI 接口。

这显然比仅使用 javax.sound 需要更多工作,但它使您可以更好地控制所使用的音频硬件。 根据我处理音频设备的经验,距离硬件太远(即 4 层抽象而不是 2 层)通常会削弱您处理多通道、高位深度、高采样率音频的能力。

Multi-channel audio is supposed to be possible in Java depending on the version of Java you are running, the platform you are running on, and the type of soundcard you are running. See the excellent Java Audio Faq For more details. I've never been able to use this reliably across all platforms.

If you really care about doing robust multichannel audio, I would recommend using a C API, such as PortAudio, Juce, or PulseAudio.

I've had excellent luck with PortAudio and Juce both.

To use these in Java you would need to create a JNI interface to the C APIs.

This obviously is more work than just using javax.sound, but it gives you a lot more control over the audio hardware you are using. In my experience dealing with audio devices, being too far removed from the hardware (i.e. 4 layers of abstraction instead of 2) often removes your ability to do serious multi-channel, high bit depth, high sample rate audio.

饭团 2024-07-17 20:06:51

我已经使用级联到 32 个输入的 Terratec 卡实现了类似的功能,当时唯一的库是 Jsyn。

一旦你了解了它,它就是一个非常好的图书馆。

http://www.softsynth.com/jsyn

我不确定是否还有其他可以帮助的。

I have implemented something similar with Terratec cards cascaded to 32 inputs, the only library at the time was Jsyn.

Its a really good library once you get to know it.

http://www.softsynth.com/jsyn

I am not sure if there is anything else that can help.

甜嗑 2024-07-17 20:06:51

我刚刚为 PortAudio 添加了一个 Java JNI 包装器。 该计划是与 PortAudio 源一起维护它。 PortAudio 支持多通道音频,其中 N>2。

今天,2012 年 9 月 3 日,JPortAudio 仍处于 alpha 模式。 当您阅读本文时,它可能已经稳定了。

http://www.portaudio.com/docs/v19-doxydocs/java_binding.html

I have just added a Java JNI wrapper for PortAudio. The plan is to maintain this along with PortAudio source. PortAudio supports multi-channel audio where N>2.

Today, 9/3/12, JPortAudio is still in alpha mode. By the time you read this it may be stable.

http://www.portaudio.com/docs/v19-doxydocs/java_binding.html

﹎☆浅夏丿初晴 2024-07-17 20:06:51

我无法直接回答 javax.sound API 是否适用于多通道(但根据 API 文档,它应该适用)。

不过,我采用了另一种使用 Java 进行多通道音频处理的方法,这可能也适合您。 我使用 Jack(Jack 音频连接套件)将信号传入和传出音频设备,然后使用 JJack 库来执行信号处理。
您没有提到您的目标操作系统。 我在Linux下成功地使用了这种方法。 AFAIR Jack 的 Windows 移植版正在路上。

再见,
榆树

I cannot give you an answer directly to whether the javax.sound API works with multi channels (But according to the API doc it should).

However, I've gone another way for multi channel audio processing with Java, that may be working for you as well. I used Jack (Jack Audio Connection Kit) to channel the signals from and to the audio device and then the JJack library to perform signal processing.
You did not mention your target OS. I used this approach successfully under Linux. AFAIR there was a Windows port for Jack on the way.

ciao,
elm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文