Cordova | 从iOS上的麦克风获取直播stream
我正在尝试构build一个语音日历应用程序,需要使用麦克风的实时stream进行语音识别。
所以你有一个button开始聆听麦克风,当用户停止说话时自动停止。
我已经探索了Cordova Media API,它允许我将数据logging到一个wav文件中。 这个工作,但使得这个过程非常缓慢,因为我需要等待录制完成。
我使用https://api.ai作为构build应用程序的第一个版本的起点。 它照顾了所有的“听”部分!
对我来说,下一个阶段是与几个不同的语音识别API集成。
我面临的主要问题是缺乏本地开发技能,那么是否有任何cordova插件可以帮助我做到这一点?
2016年4月1日更新
find这个https://subvisual.co/blog/posts/39-tutorial-html-audio-capture-streaming-to-node-js-no-browser-extensions将试图通过webrtc在cordova实现这一点。
2016年4月2日更新
安装https://github.com/eface2face/cordova-plugin-iosrtc来利用webrtc
2016年4月3日至2日更新
卡在AudioContext.createMediaStreamSource
不是iOS上的function! AudioContext.createMediaStreamSource替代iOS?
2016年4月4日至6日更新
本土化 – 学习iOS开发的时间!
很抱歉听说你放弃了cordova,但是如果你仍然感兴趣:我已经为iOS和Android创build了一个cordova插件,使您能够捕获麦克风数据并将其转发到应用程序的Web层。 您可以依靠Web Audio API处理传入的声音,或者使用任何其他方式编码并保存原始声音数据:
https://github.com/edimuj/cordova-plugin-audioinput
用法示例:
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();