export function speechToTextRequest() {
    if(window && window.courseware && window.courseware.startRecord) {
        console.log("检测到startRecord，使用线上环境");
        const startRealtimeRecord = window?.courseware?.startRecord;
        if (startRealtimeRecord) {
            startRealtimeRecord(1); // 1-录音转文字 0-录音
        }
        return window.courseware.stopRecord
    } else {
        console.log("未检测到中间层startRecord方法，使用模拟数据")
        const mockData = '{"text":"hello hello","audioUrl":"https://staging-teach.cdn.ireadabc.com/e276db31319b531d79538f83ebc064fb.mp3"}';
        const stopHandler = (callback) =>{
            callback && callback(mockData)
        }
        return stopHandler
    }
}