From 39c4dbac069c9d055814f2eaccded4c3345183f2 Mon Sep 17 00:00:00 2001 From: Jinx Date: Sat, 20 Jan 2024 18:24:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(types):=20=20=E8=A1=A5=E5=85=85=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=20createInnerAudioContext=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8F=82=E6=95=B0=E6=9B=B4=E6=96=B0=20(#1511?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 微信createInnerAudioContext 接口类型 * fix: add supported note * Update audio.d.ts * Update audio.d.ts --------- Co-authored-by: jinhaidi Co-authored-by: Zakary --- packages/taro/types/api/media/audio.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/taro/types/api/media/audio.d.ts b/packages/taro/types/api/media/audio.d.ts index a82fd31408f5..0d8eedcac9f0 100644 --- a/packages/taro/types/api/media/audio.d.ts +++ b/packages/taro/types/api/media/audio.d.ts @@ -800,6 +800,15 @@ declare module '../../index' { setPosition(...args: any[]): void } + namespace createInnerAudioContext { + interface Option { + /** 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项。 + * @supported weapp + */ + useWebAudioImplement: boolean + } + } + interface TaroStatic { /** 结束播放语音。 * **注意:1.6.0 版本开始,本接口不再维护。建议使用能力更强的 [Taro.createInnerAudioContext](./createInnerAudioContext) 接口** @@ -979,7 +988,7 @@ declare module '../../index' { * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createInnerAudioContext.html */ - createInnerAudioContext(): InnerAudioContext + createInnerAudioContext(option?: createInnerAudioContext.Option): InnerAudioContext /** 创建 audio 上下文 AudioContext 对象。 * **注意:1.6.0 版本开始,本接口不再维护。建议使用能力更强的 [Taro.createInnerAudioContext](./createInnerAudioContext) 接口**