def asr_func(audio_file_path: Union[np.ndarray, bytes, str], output_path: str = None, **kwargs):
    """
    Compute ASR result from audio file.
    """
    global speech_recognition_model
    if speech_recognition_model is None:
        speech_recognition_model = SpeechRecognition(**kwargs)
    r = speech_recognition_model.predict(audio_file_path)
    res_text = r.get("text", "")
    print(res_text, end='')  # Stdout
    if output_path:
        with open(output_path, "w") as f:
            f.write(res_text)
        logger.debug(f"ASR done, result saved: {output_path}")

    Compute ASR result from audio file.
    
parrots/cli.py