网友回复
1、python语音识别可以使用speech_recognition
安装pip install speech_recognition
识别代码:
# -*- coding: utf-8 -*-
# /usr/bin/python
import speech_recognition as sr
r = sr.Recognizer() #调用识别器
test = sr.AudioFile("/data/wwwroot/default/asset/voice.flac") #导入语音文件
with test as source:
audio = r.record(source)
type(audio)
c=r.recognize_sphinx(audio, language='zh-cn') #识别输出
print(c)
注意:pocketsphinx需要安装的中文语言、声学模型下载地址:ht...
点击查看剩余70%
还可以使用微软的文字转语音服务,支持140种语言,声音非常接近人声
import asyncio
from msspeech import MSSpeech
async def main():
mss = MSSpeech()
print("Geting voices...")
voices = await mss.get_voices_list()
print("人工智能是未来")
for voice in voices:
if voice["Loca...点击查看剩余70%


