pydub.AudioSegment.from_mp3(file_src)
def recognition(file_src, file_src2):
with open(file_src, 'rb') as f:
audio = f.read()
sound = pydub.AudioSegment(audio)
sound.export(file_src2, format="wav")
sample_audio = sr.AudioFile(file_src2)
key = sr.recognize_google(sample_audio)
return key
True False
import speech_recognition as sr
import pydub
import os.path
def recognition(file_src, file_src2):
sound = pydub.AudioSegment.from_mp3(file_src)
sound.export(file_src2, format="wav")
sample_audio = sr.AudioFile(file_src2)
key = sr.recognize_google(sample_audio)
return key
print(os.path.isfile('audio5.mp3'), os.path.isfile('test.waw'))
True False
with open(file_src, 'rb') as f:
print(f.readlines())
--onefile
и у вас в папке dist будет один exe со всеми модулями <code></code>
No Python at 'C:\Users\markh\AppData\Local\Programs\Python\Python38-32\python.exe'Перевод: python нет в 'C:\Users\markh\AppData\Local\Programs\Python\Python38-32\python.exe'