带有Port(s)和DataLine(s)的JavaSound混音器? [英] JavaSound mixer with both Port(s) and DataLine(s)?

查看:146
本文介绍了带有Port(s)和DataLine(s)的JavaSound混音器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JavaSound API程序员指南中的图表似乎暗示(第19-20页)混音器原则上可以同时具有DataLines和Ports。但是,我想知道是否有人真的看到过这种配置?我见证的是,在相关的情况下,混音器成对出现,一个带有源/目标数据线,另一个带有相应的端口。

The diagrms in the JavaSound API Programmer's Guide appear to imply (pp. 19-20) that a Mixer can in principle have both DataLines and Ports. However, I was wondering if anyone had actually seen this configuration? What I witness is that where relevant, Mixers come in pairs, one with a source/target data line, and then the other with the corresponding Port.

有没有人目睹过指南中隐含的配置,混音器有端口和数据线(或者我误解了指南)?

Has anyone witnessed a configuration as implied in the Guide, with a mixer having both port and data line (or am I misinterpreting the guide)?

推荐答案

似乎JavaSound API的目的是允许Mixer同时处理DataLines和Ports。但是,包含在JRE中的API的Sun实现有四个具体类(DirectAudioDevice,SimpleInputDevice,HeadspaceMixer和PortMixer),每个类只处理一个或另一个。它们具有映射到操作系统处理音频的方式的本机方法,并且保持逻辑分离(类不小)是有意义的。没有1:1的数据线到端口(例如我有5x DirectAudioDevice和3x PortMixer)所以程序员可以决定使用什么(或向用户公开以进行控制)。也许有针对特定设备的API的第三方实现,它们将两者合并为一个混音器实现,但我还没有看到一个。

It would appear that the intention of the JavaSound API was to allow a Mixer to handle both DataLines and Ports. However the Sun implementation of the API that's included in the JRE has four concrete classes (DirectAudioDevice, SimpleInputDevice, HeadspaceMixer and PortMixer) that each only handle one or the other. They have native methods that map to the way the OS handles audio and it makes sense to keep the logic separate (the classes aren't small). There's not a 1:1 of DataLines to Ports (I for example have 5x DirectAudioDevice and 3x PortMixer) so it's up the programmer to determine what to use for what (or expose to the user for control). Perhaps there are 3rd party implementations of the API for specific devices which combine the two into one Mixer implementation, however I haven't seen one.

这篇关于带有Port(s)和DataLine(s)的JavaSound混音器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆