const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = 'https://web-ext-storage.dcloud.net.cn/uni-app/ForElise.mp3';
innerAudioContext.playbackRate = 2.0;
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});

- 发布:2025-02-21 15:16
- 更新:2025-02-21 19:34
- 阅读:15
产品分类: uniapp/快应用/华为
渲染模式: webview
示例代码:
操作步骤:
运行上面代码不能改变播放速度
运行上面代码不能改变播放速度
预期结果:
应该是2倍速播放
应该是2倍速播放
实际结果:
还是1倍速播放
还是1倍速播放
bug描述:
在快应用开发是调用uni.createInnerAudioContext()播放音频时,调整播放速率的参数playbackRate无效
1 个回复
DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信
查阅文档 快应用不支持 倍速播放
https://uniapp.dcloud.net.cn/api/media/audio-context.html