java 混音器,带有Port(s)和DataLine(s)的JavaSound混音器?

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)?

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值