Ошибки вывода API распознавания речи Google, не знаю, почему они происходят - PullRequest
1 голос
/ 08 ноября 2019

Это вывод при подаче файлов flac в Google Speech Recognition API. Он говорит, что если большинство файлов запускается и заканчивает работу, но он выдает эти ошибки, когда подходит к концу. Я проверил, и все эти файлы являются родными файлами FLAC. Я вынул большую часть вывода выше «source / out70.flac начался», потому что он все тот же, кроме номера файла.

source/out70.flac started
source/out25.flac started
source/out17.flac done
source/out18.flac started
source/out25.flac done
source/out20.flac done
source/out21.flac started
source/out10.flac done
source/out100.flac started
source/out14.flac done
source/out18.flac done
source/out21.flac done
Traceback (most recent call last):
  File "C:\Users\hmkur\AppData\Roaming\Python\Python37\site-packages\speech_recognition\__init__.py", line 203, in __enter__
    self.audio_reader = wave.open(self.filename_or_fileobject, "rb")
  File "C:\Program Files (x86)\Python37-32\lib\wave.py", line 510, in open
    return Wave_read(f)
  File "C:\Program Files (x86)\Python37-32\lib\wave.py", line 164, in __init__
    self.initfp(f)
  File "C:\Program Files (x86)\Python37-32\lib\wave.py", line 129, in initfp
    self._file = Chunk(file, bigendian = 0)
  File "C:\Program Files (x86)\Python37-32\lib\chunk.py", line 63, in __init__
    raise EOFError
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hmkur\AppData\Roaming\Python\Python37\site-packages\speech_recognition\__init__.py", line 208, in __enter__
    self.audio_reader = aifc.open(self.filename_or_fileobject, "rb")
  File "C:\Program Files (x86)\Python37-32\lib\aifc.py", line 917, in open
    return Aifc_read(f)
  File "C:\Program Files (x86)\Python37-32\lib\aifc.py", line 352, in __init__
    self.initfp(file_object)
  File "C:\Program Files (x86)\Python37-32\lib\aifc.py", line 314, in initfp
    chunk = Chunk(file)
  File "C:\Program Files (x86)\Python37-32\lib\chunk.py", line 63, in __init__
    raise EOFError
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hmkur\AppData\Roaming\Python\Python37\site-packages\speech_recognition\__init__.py", line 234, in __enter__
    self.audio_reader = aifc.open(aiff_file, "rb")
  File "C:\Program Files (x86)\Python37-32\lib\aifc.py", line 917, in open
    return Aifc_read(f)
  File "C:\Program Files (x86)\Python37-32\lib\aifc.py", line 358, in __init__
    self.initfp(f)
  File "C:\Program Files (x86)\Python37-32\lib\aifc.py", line 314, in initfp
    chunk = Chunk(file)
  File "C:\Program Files (x86)\Python37-32\lib\chunk.py", line 63, in __init__
    raise EOFError
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hmkur\Desktop\Python\Transcribing_Audio_GoogleAPI_Python\fast.py", line 92, in <module>
    all_text = pool.map(transcribe, enumerate(files))
  File "C:\Program Files (x86)\Python37-32\lib\multiprocessing\pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "C:\Program Files (x86)\Python37-32\lib\multiprocessing\pool.py", line 657, in get
    raise self._value
  File "C:\Program Files (x86)\Python37-32\lib\multiprocessing\pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "C:\Program Files (x86)\Python37-32\lib\multiprocessing\pool.py", line 44, in mapstar
    return list(map(*args))
  File "C:\Users\hmkur\Desktop\Python\Transcribing_Audio_GoogleAPI_Python\fast.py", line 82, in transcribe
    with sr.AudioFile(name) as source:
  File "C:\Users\hmkur\AppData\Roaming\Python\Python37\site-packages\speech_recognition\__init__.py", line 236, in __enter__
    raise ValueError("Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format")
ValueError: Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...