Cordova |在iOS上从麦克风获取即时串流 [英] Cordova | Get live stream from microphone on iOS

查看:1803
本文介绍了Cordova |在iOS上从麦克风获取即时串流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个语音日历应用程式,需要使用麦克风的即时串流功能进行语音识别。

I am trying to build a voice calendar app that needs to use live stream from the microphone for speech recognition.

因此,您有一个按钮开始聆听麦克风,并在用户停止说话时自动停止。

So you have a button that starts listening to the microphone and stops automatically when the user stops speaking.

我已经探讨了Cordova Media API,允许我将数据记录到wav文件。

I have already explored Cordova Media API that allows me to record the data to a wav file. This works but makes the process very slow since I need to wait for the recording to be finished.

我使用 https://api.ai 作为开始构建应用程序的第一个版本的工作相当不错。它照顾了所有的听部分!

I used the https://api.ai as a starting point to build the 1st version of the app which works quite well. It took care of all the "listening" part!

我的下一个阶段是集成几种不同的语音识别API。

Next phase for me is to integrate with a few different speech recognition APIs.

我的主要问题是缺乏本地开发技能,所以有没有可以帮助我这样做的cordova插件?

The major issue for me has been the lack of native development skills, so are there any cordova plugins that can help me do this?

更新1 - 2016年4月1日

找到此 https://subvisual.co/blog/posts/39-tutorial-html-audio-capture-streamingtoto -node-js-no-browser-extensions
将尝试通过webrtc在cordova中实现。

Found this https://subvisual.co/blog/posts/39-tutorial-html-audio-capture-streaming-to-node-js-no-browser-extensions Will be trying to implement this in cordova through webrtc.

更新2 - 2016年4月1日

安装 https://github.com/eface2face/cordova-plugin-iosrtc 以利用webrtc

Installed https://github.com/eface2face/cordova-plugin-iosrtc to utilize webrtc

更新3 - 2016年4月2日

AudioContext.createMediaStreamSource 不是iOS上的一个函数!
iOS的AudioContext.createMediaStreamSource替代方案

2016年4月4日至6日更新

时间学习iOS开发!

推荐答案

很抱歉听到你放弃了Cordova,但如果你还是有兴趣:我们为iOS和Android创建了一个cordova插件,可以捕获麦克风数据并将其转发到应用程序的web层。您可以依靠Web Audio API处理传入的声音,也可以使用任何其他方式对原始声音数据进行编码和保存:

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

使用示例:

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();

这篇关于Cordova |在iOS上从麦克风获取即时串流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆