'Performs speech recognition on ``audio_data`` (an ``AudioData`` instance), using the Houndify API.
The Houndify client ID and client key are specified by ``client_id`` and ``client_key``, respectively. Unfortunately, these are not available without `signing up for an account <https://www.houndify.com/signup>`__. Once logged into the `dashboard <https://www.houndify.com/dashboard>`__, you will want to select "Register a new client", and fill in the form as necessary. When at the "Enable Domains" page, enable the "Speech To Text Only" domain, and then select "Save & Continue".
To get the client ID and client key for a Houndify client, go to the `dashboard <https://www.houndify.com/dashboard>`__ and select the client\'s "View Details" link. On the resulting page, the client ID and client key will be visible. Client IDs and client keys are both Base64-encoded strings.
Currently, only English is supported as a recognition language.
Returns the most likely transcription if ``show_all`` is false (the default). Otherwise, returns a JSON dictionary.
Raises a ``speech_recognition.UnknownValueError`` exception if the speech is unintelligible. Raises a ``speech_recognition.RequestError`` exception if the speech recognition operation failed, if the key isn\'t valid, or if there is no internet connection.'

def recognize_houndify(self, audio_data, client_id, client_key, show_all=False):

    assert isinstance(audio_data, AudioData), 'Data    must    be    audio    data'
    assert isinstance(client_id, str), '``client_id``    must    be    a    string'
    assert isinstance(client_key, str), '``client_key``    must    be    a    string'
    wav_data = audio_data.get_wav_data(convert_rate=(None if (audio_data.sample_rate in [8000, 16000]) else 16000), convert_width=2)
    url = 'https://api.houndify.com/v1/audio'
    (user_id, request_id) = (str(uuid.uuid4()), str(uuid.uuid4()))
    request_time = str(int(time.time()))
    request_signature = base64.urlsafe_b64encode(hmac.new(base64.urlsafe_b64decode(client_key), (((user_id.encode('utf-8') + ';') + request_id.encode('utf-8')) + request_time.encode('utf-8')), hashlib.sha256).digest()).decode('utf-8')
    request = Request(url, data=wav_data, headers={'Content-Type': 'application/json', 'Hound-Request-Info': json.dumps({'ClientID': client_id, 'UserID': user_id}), 'Hound-Request-Authentication': '{};{}'.format(user_id, request_id), 'Hound-Client-Authentication': '{};{};{}'.format(client_id, request_time, request_signature)})
    try:
        response = urlopen(request, timeout=self.operation_timeout)
    except HTTPError as e:
        raise RequestError('recognition    request    failed:    {}'.format(e.reason))
    except URLError as e:
        raise RequestError('recognition    connection    failed:    {}'.format(e.reason))
    response_text = response.read().decode('utf-8')
    result = json.loads(response_text)
    if show_all:
        return result
    if (('Disambiguation' not in result) or (result['Disambiguation'] is None)):
        raise UnknownValueError()
    return result['Disambiguation']['ChoiceData'][0]['Transcription']
