简体   繁体   English

我会为语音识别选择什么设备来使用我的计算机发出的音频?

[英]What device I would select for Speech Recognition to use the audio coming out of my computer?

I'm trying to make a closed captions generator using Python 3. When I call list_microphone_names() , a bunch of audio sources are listed.我正在尝试使用 Python 3 制作隐藏式字幕生成器。当我调用list_microphone_names() ,会列出一堆音频源。 Which source would I select for the audio that comes out of my computer?我会为从我的计算机发出的音频选择哪个来源?

I've tried using pocketsphinx for live recognition but the results are horribly inaccurate.我曾尝试使用pocketsphinx进行实时识别,但结果非常不准确。 I've found an option for using the -adcdev parameter to select a source but I don't know what to put into it.我找到了一个使用-adcdev参数来选择源的选项,但我不知道要放入什么。

Here is what I get from calling list_microphone_names() :这是我从调用list_microphone_names()

>>> import speech_recognition as sr
>>> r = sr.Recognizer()
>>> mic = sr.Microphone()
>>> sr.Microphone.list_microphone_names()
['Microsoft Sound Mapper - Input', 
'Microphone (HD Webcam C270)', 
'Microsoft Sound Mapper - Output', 
'Speakers (Realtek High Definiti', 
'Primary Sound Capture Driver', 
'Microphone (HD Webcam C270)', 
'Primary Sound Driver', 
'Speakers (Realtek High Definition Audio)', 
'Speakers (Realtek High Definition Audio)', 
'Microphone (HD Webcam C270)', 
'Line In (Realtek HD Audio Line input)', 
'Speakers (Realtek HD Audio output)', 
'Microphone (Realtek HD Audio Mic input)', 
'Stereo Mix (Realtek HD Audio Stereo input)', 
'Microphone (HD Webcam C270)']

I'm guessing Stereo Mix because this article explains how to record the sound coming from your computer without using Stereo Mix.我猜是立体声混音,因为本文解释了如何在使用立体声混音的情况下录制来自计算机的声音。

If it is possible for accurate, live speech recognition with speech_recognition for the audio that comes out of my computer, I'm all in for it.如果可以使用语音识别功能对我的计算机发出的音频进行准确、实时的语音识别,那么我全力支持。

Running Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32 . Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32运行Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32

Rather than listing all available microphones, consider using Microphone.list_working_microphones() that lists only those currently hearing sound.与其列出所有可用的麦克风,不如考虑使用Microphone.list_working_microphones()仅列出当前听到声音的Microphone.list_working_microphones() Make sure to make some noise, otherwise the function may return an empty list.确保发出一些噪音,否则该函数可能会返回一个空列表。 After you got the list of working microphones, try them one by one and finally pick up the one with which recognition quality is the best.拿到工作话筒列表后,一一试用,最后挑出识别质量最好的那一个。

The code snippet below simply picks the first one working:下面的代码片段只是选择第一个工作:

for device_index in Microphone.list_working_microphones():
    m = Microphone(device_index=device_index)
    break
else:
    print("No working microphones found!")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我不能使用语音识别 - I can not use speech_recognition 如何在 proxy.network 上使用 Python 中的语音识别? - How can I use speech recognition in Python on a proxy network? 语音识别在我的代码中不起作用 - speech recognition not working in my code Python:如何使用 Speech_recognition 或其他模块将 base64 音频字符串转换为文本? - Python : How to use speech_recognition or other modules to convert base64 audio string to text? 有没有办法在 AGI python 中使用 stream 实时音频进行语音识别? - Is there any way to stream live audio for speech recognition in AGI python? python 中带有语音识别的“AssertionError:此音频源已在上下文管理器中” - "AssertionError: This audio source is already inside a context manager" with Speech Recognition in python 我无法在 Python 中使用 speech_recognition 看到我的文本 output - I'm not able to see my text output using speech_recognition in Python 如何使我的语音识别暂停阈值正常工作 - How do I make my speech_recognition pause threshold work correctly 如何确定给定设备的kivy应用高度和宽度? - how can i figure out what my kivy app heigth and width should be for a given device? 我如何让Discord机器人从计算机播放音频文件 - How do i get my discord bot to play an audio file from my computer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM