抖音开放平台Logo
开发者文档
“/”唤起搜索
控制台

RecorderManager.pause
收藏
我的收藏

基础库 1.0.0 开始支持本方法,这是一个同步方法。

暂停录音

前提条件
业务背景
使用限制
注意事项
相关教程

语法

RecorderManager.pause()

参数说明

返回值

错误码

errNoerrMsg说明最低支持版本
20000Operation type is null
1.0.0
21000Operation type is error
1.0.0
20000internal error
小游戏框架内部错误,有需要请创建工单咨询
1.0.0

代码示例

const recorderManager = tt.getRecorderManager(); const options = { duration: 60000, sampleRate: 12000, numberOfChannels: 1, encodeBitRate: 25000, frameSize: 100, }; recorderManager.start(options); tt.showToast({ title: "开始录音" }); tt.onTouchEnd(function () { recorderManager.pause(); tt.showToast({ title: "暂停录音" }); });