是的,JavaSound API可用于从MIDI设备读取MIDI数据。
JFugue是用于音乐编程的Java API,它使用JavaSoundAPI,可以帮助简化与JavaSound的交互。在JFugue5.x中,从MIDI设备捕获10秒MIDI数据的示例代码如下:
MidiDevice device = MusicTransmitterToSequence transmitter = new MusicTransmitterToSequence(device); transmitter.listenForMillis(10000); Sequence music = transmitter.getSequence();您还可以开始和停止收听设备:MidiDevice device = MusicTransmitterToSequence transmitter = new MusicTransmitterToSequence(device); transmitter.startListening(); // Do stufftransmitter.stopListening(); Sequence music = transmitter.getSequence();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)