2016-11-16 69 views
0

我做了一个小型的网络浏览器调谐器测试。我想在android和ios上测试它。我听说intelXDK可以模拟,编译,并且可以添加cordova插件。我在网络浏览器中使用的API获取声音频率为this。我对此有点新,所以我不确定该代码是否适用于android和ios,但我认为它不起作用。我需要类似的东西,我认为科尔多瓦插件将是解决方案。我发现这一点:使用cordova插件的Android/ios中的频率检测?

你知道,如果它是什么好,如果它会做同样的工作的API?或者即使api会很好? 谢谢

回答

1

有人写了一个网络音频库,其中,可以检测麦克风输入的频率。在https://github.com/rserota/wad#pitch-detection

var voice = new Wad({source : 'mic' }); 
var tuner = new Wad.Poly(); 
tuner.add(voice); 
voice.play(); 

tuner.updatePitch() // The tuner is now calculating the pitch and note name of its input 60 times per second. These values are stored in tuner.pitch and tuner.noteName. 

var logPitch = function(){ 
    console.log(tuner.pitch, tuner.noteName) 
    requestAnimationFrame(logPitch) 
}; 
logPitch(); 
// If you sing into your microphone, your pitch will be logged to the console in real time. 

tuner.stopUpdatingPitch(); // Stop calculating the pitch if you don't need to know it anymore. 
+0

那么我已经有一个工作得很好,但这似乎更干净的api。由于浏览器许可,我面临麻烦。我对麦克风访问权限说是,但它在控制台中说我不接受它。你知道这是否会在iOS/Android上工作吗? – DigitalEvolution

+0

请尝试。直到现在我还没有尝试过。 –

+0

哈桑阿里我经过许可解决了这个问题。是的,将不得不尝试在android/ios上 – DigitalEvolution