I am noob, and this is my firts post here.
I’m writing a program, which should recognize speech from audio file (and first transform file from .ogg to .wav).
Here is my code:
import speech_recognition
import pydub
def ogg2wav(filename):
new_filename = filename.replace('.ogg', '.wav')
audio = pydub.AudioSegment.from_file(filename)
audio.export(new_filename, format='wav')
return new_filename
ogg2wav("audio.ogg")
recognizer = speech_recognition.Recognizer()
with speech_recognition.WavFile('audio.wav') as source:
wav_audio = recognizer.record(source)
print(recognizer.recognize_whisper(wav_audio, language='ru'))
when I run a program I get an error:
Traceback (most recent call last):
File "C:/Users/Алексей/PycharmProjects/pythonProject1/skillbox_voice_transform.py", line 17, in <module>
print(recognizer.recognize_whisper(wav_audio, language='ru'))
File "C:UsersАлексейAppDataRoamingPythonPython38site-packagesspeech_recognition__init__.py", line 1408, in recognize_whisper
import whisper
File "C:UsersАлексейAppDataRoamingPythonPython38site-packageswhisper.py", line 69, in <module>
libc = ctypes.CDLL(libc_name)
File "C:Program FilesPython38libctypes__init__.py", line 363, in __init__
if '/' in name or '\' in name:
TypeError: argument of type 'NoneType' is not iterable
How to fix it?
Thanks
I searched this error in google, but found only general information.
New contributor
Alex Nedelchuk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.