直接将音频流写入麦克风缓冲区? [英] Write an Audio Stream Directly to Microphone Buffer?

查看:267
本文介绍了直接将音频流写入麦克风缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的用例如下:将音频从客户端流式传输到服务器,服务器将接收音频并对其进行实时语音识别(IE:写入文件并处理这些文件将无法正常工作) )在无法访问互联网的环境中。 

My use case is the following: Stream audio from a client to a server, which will receive the audio and do speech recognition on it in real time (IE: Writing to files and processing those files will not work well) in an environment with no internet access. 

我成功将音频流式传输到我的服务器并使用NAudio我能够实时播放该音频(BufferedWaveProvider)或保存将音频传输到Memory Stream并播放。在完成传输后,我还能够在
内存流上进行语音识别。 

I am successfully streaming the audio to my server and using NAudio I am capable of playing that audio back in real time (BufferedWaveProvider) or saving the audio to a Memory Stream and playing it back. I am also capable of doing speech recognition on that Memory Stream after I have finished transmitting. 

现在我的问题有两个 - 首先,仅限UWP语音识别库允许来自默认音频设备的输入。

Now my issues are two fold - first, the UWP Speech Recognition library ONLY allows input from the default audio device.

.NET库有其他方法,但它们都需要一个流,根据我迄今为止的基本理解,它不能用于实时处理(我会完成写入流,处理,写入流,处理等。)

The .NET library has other methods, but they all require a stream, which from my basic understanding thus far, cannot be used with real time processing (I would finish writing to the stream, process, write to stream, process, etc).

我能想到的最好的解决方案 - 适用于任何一个库,是使用默认音频设备,但以编程方式将我的音频从应用程序流式传输到默认音频设备缓冲区。但是......这似乎不是Windows本机支持的
(或者至少,它很难找到它的信息)。

The best solution that I could think of - that would work for either library, is to use the Default Audio Device, but programmatically stream my audio from my application to the Default Audio Device buffer. But... this does not seem to be something that Windows natively supports (or at least, it is very difficult to find information on it).

所以,至少我正在寻找有关如何在C#中使用输出设备缓冲区的指导,但最好的是我正在寻求帮助让这些语音引擎开始工作。 

So, at least I am looking for guidance on how to user an output device buffer in C#, but at best I am looking for assistance getting this speech engines off the ground. 

推荐答案

我担心你的问题描述会让我感到困惑。

I'm afraid your problem description has confused me.

好的,所以你有一个客户端系统。 在该系统上,您正在捕获麦克风流并将其路由到您的服务器。 在您的服务器上,您正在进行语音识别。 这一切都正常,对吗?

OK, so you have a client system.  On that system, you are capturing the microphone stream and routing it to your server.  On your server, you are doing speech recognition.  And that's all working, right?

那么缺少什么? 你想用音频流做点什么吗? 在哪个系统?

So what is missing?  Do you want to do something else with the audio stream?  On which system?


这篇关于直接将音频流写入麦克风缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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