本文介绍了如何在web midi api中发现midi键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考:

目前,我正在OS 10.9.2上运行Chrome 34.0.1847.116并尝试使用Web Midi API。启用chrome:// flags /#enable-web-midi后,我可以通过粘贴以下代码来获取midiAccess对象:进入DevTools控制台。

I'm currently running Chrome 34.0.1847.116 on OS 10.9.2 and experimenting with the Web Midi API. After enabling chrome://flags/#enable-web-midi, I'm able to get a midiAccess object by pasting the following code from http://www.w3.org/TR/webmidi/ into the DevTools console.

var midi = null;  // global MIDIAccess object

function onMIDISuccess( midiAccess ) {
  console.log( "MIDI ready!" );
  midi = midiAccess;  // store in the global (in real usage, would probably keep in an object instance)
}
function onMIDIFailure(msg) {
console.log( "Failed to get MIDI access - " + msg );
}
navigator.requestMIDIAccess().then( onMIDISuccess, onMIDIFailure );

当我查询midi.inputs()和midi.outputs()时,返回的列表仅包含IAC总线设备。我的midi键盘(连接Turtle Beach USB midi适配器)没有出现。在试图诊断问题时,我到目前为止发现了以下内容:

When I query midi.inputs() and midi.outputs(), the returned list contains only IAC Bus devices. My midi keyboard (connected with a Turtle Beach USB midi adapter) does not show up. In trying to diagnose the problem, I've so far found the following:


  • 适配器在OS X的Audio / Midi安装程序中可见并且键盘可以正确使用Logic Pro以及自制CoreMidi代码。

  • Web合成器示例也无法找到键盘,并且在按键时不发声。

  • 这篇关于如何在web midi api中发现midi键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 02:29
查看更多