Cordova | Get live stream from microphone on iOS

可紊 提交于 2019-12-03 17:07:56

Sorry to hear that you gave up on Cordova, but if you still are interested: I've created a cordova plugin for iOS and Android, that enables you to capture microphone data and forward it to the web layer of your application. You can either rely on the Web Audio API to handle the incoming sound, or use any other way to encode and save the raw sound data:

https://github.com/edimuj/cordova-plugin-audioinput

Example usage:

function onAudioInput( evt ) {
  // 'evt.data' is an integer array containing raw audio data
  console.log( "Audio data received: " + evt.data.length + " samples" );

  // ... do something with the evt.data array ...
}

// Listen to audioinput events
window.addEventListener( "audioinput", onAudioInput, false );

// Start capturing audio from the microphone
audioinput.start();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!