Python 3音声認識(テキストへの音声)



Pythonを使用したテキストへの音声

音声認識はホームオートメーション、人工知能などのいくつかのアプリケーションで重要な特徴です.この記事は、Pythonのspeechrecognitionとpyttsx 3ライブラリの使用方法についての導入を提供することを目的としています.
音声認識のために、我々はPIIP
pip install SpeechRecognition
パッケージをインストールした後に、以下のコードをコピーしてペーストし、プログラムを実行する必要があります
import speech_recognition as sr
# importing pachage
r=sr.Recognizer()
print(sr.Microphone.list_microphone_names())
# checking for microphone
with sr.Microphone() as source:
    r.adjust_for_ambient_noise(source,duration=1)
    # r.energy_threshold()
    print("say anything : ")
    audio= r.listen(source)
    try:
        text = r.recognize_google(audio)
        print(text)
    except:
        print("sorry, could not recognise")
をお楽しみくださいコーディング!
あなたがこのレッスンを読んで楽しんだことを願っていますあなたは将来的に私からより多くのチュートリアルを読むためにfollow meすることができます.あなたの時間をありがとう.
媒体のメンバーになることで、私とあなたの他のお気に入りの著者をサポートすることができます.ありがとう👇
Join Medium with my referral link - Harendra Verma