ソースコード
#!/usr/bin/env python3
import speech_recognition as sr
r = sr.Recognizer()
with sr.AudioFile("1-01.wav") as source:
audio = r.record(source)
# text = r.recognize_google(audio, language='ja-JP')
text = r.recognize_google(audio, language='en-US')
print(text)
結果
TOEFL test must word 5,000 1:32 modern physical anthropology a major shift in the approach to physical anthropology occurred with the discovery of genetic principles to Gregor J Mendel had formulated the first laws of heredity 3 he had laid the foundation of the science of genetics for genes are the units within sex cells five the sperm and egg transmitted specific hereditary traits from one generation to the next six characteristics to be discarded in the hereditary process 7 blood types are genetically determined 8 we can trace early migration patterns