def recognize(wav_filename, lang):
    (data, s) = librosa.load(wav_filename)
    librosa.output.write_wav('output/tmp.wav', data, s)
    y = (np.iinfo(np.int32).max * (data / np.abs(data).max())).astype(np.int32)
    wavfile.write('output/tmp_32.wav', s, y)
    r = sr.Recognizer()
    with sr.AudioFile('output/tmp_32.wav') as source:
        audio = r.record(source)
    print('Audio file has been loaded')
    try:
        result = r.recognize_google(audio, language=lang).lower()
    except sr.UnknownValueError:
        print('Failed to determine audio file')
        result = ''
    return result
def recognize(wav_filename, lang):
    (data, s) = librosa.load(wav_filename)
    librosa.output.write_wav('output/tmp.wav', data, s)
    y = (np.iinfo(np.int32).max * (data / np.abs(data).max())).astype(np.int32)
    wavfile.write('output/tmp_32.wav', s, y)
    r = sr.Recognizer()
    with sr.AudioFile('output/tmp_32.wav') as source:
        audio = r.record(source)
    print('Audio file has been loaded')
    try:
        result = r.recognize_google(audio, language=lang).lower()
    except sr.UnknownValueError:
        print('Failed to determine audio file')
        result = 
    return result