0

I try to read the text from audio file:

import speech_recognition as sr

# obtain path to "english.wav" in the same folder as this script
from os import path
AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "09.04.01 KMCTC.wav")
# AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "french.aiff")
# AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "chinese.flac")

# # use the audio file as the audio source
r = sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:
    audio = r.record(source)  # read the entire audio file

HOUNDIFY_CLIENT_ID = "qt-kd2mxXrlJO-eZGfvV_A=="  # Houndify client IDs are Base64-encoded strings
HOUNDIFY_CLIENT_KEY = "YAeInVWu2yamXAmw8KBVeMpiBA7kvVijysDF0HW-jm9oZA0ip97dH38nOSuQPGG7suxKuZg3MLgdjrVjPB74ZA=="  # Houndify client keys are Base64-encoded strings
try:
    print("Houndify thinks you said " + r.recognize_houndify(audio, client_id=HOUNDIFY_CLIENT_ID, client_key=HOUNDIFY_CLIENT_KEY))
except sr.UnknownValueError:
    print("Houndify could not understand audio")
except sr.RequestError as e:
    print("Could not request results from Houndify service; {0}".format(e))

and I don't know why I get the same error:

    raise RemoteDisconnected("Remote end closed connection without" 
http.client.RemoteDisconnected: Remote end closed connection without response

How it fix? Any idea? Google Cloud Speech and other services dont'working (problems with API) using houndify I at least I could get the keys and go...

Alex
  • 195
  • 10

1 Answers1

0

Had this error too on long audio files, seems to work on audio files < 1 min though. Both this houndify and wit.ai seems to be meant for short commands or queries like Alexa style

  • The answer is not clear – Adrian B Mar 16 '22 at 07:19
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 16 '22 at 07:20
  • file duration: 4:00 minutes – Alex Mar 16 '22 at 13:44