更新记录
1.0.0(2025-06-10)
提交组件
平台兼容性
uni-app(4.44)
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | × | × | × | × | × |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | × | × | × | × | × |
目前仅支持H5
一、讯飞语音转写
讯飞实时语音转写文字
二、简介
开箱即用,对60秒录音进行识别实时转写,快速准确识别,可应用于语音消息转写等场景。
三、执行命令
npm install crypto-js
四、使用
示例
<view>
<xunFeiTranscription :config='config' ref="audio" @transcribeContent="transcribeContent"
@recordingStatus="recordingStatus" @endRecording="endRecording" />
</view>
<script setup>
import xunFeiTranscription from '@/components/transcription/index.vue'; //科大讯飞组件(语音转写)
import {
ref,
getCurrentInstance
} from 'vue'
const {
proxy
} = getCurrentInstance(),
config = ref({
appid: "*********",
apiSecret: "*********",,
apiKey: "*********",,
})
// 开始录音
const startRecord = () => {
proxy.$refs.audio.start()
}
// 停止录音
const endRecord = () => {
proxy.$refs.audio.stop()
}
// 转写内容
const transcribeContent = (content) => {
result.value = content
}
// 识别完成
const endRecording = () => {
}
// 录音状态
const recordingStatus = (content) => {
state.value = content
}