package com.yeejoin.amos.boot.module.jcs.biz.audioToText.streamToText;

import org.typroject.tyboot.core.restful.exception.instance.BadRequest;

import java.io.InputStream;

/**
 * 语音文件输入流，转文字
 */
public abstract class AbstractInputStream2Text {
    private InputStream inputStream;

    /**
     * 获取输入流
     */
    abstract InputStream getInputStream();

    /**
     * 转换操作
     */
    void doTranslate() {
        inputStream = getInputStream();
        if (inputStream == null) {
            throw new BadRequest("inputStream is null");
        }


    }
}
