Skip to content

Commit

Permalink
fix(types): 补充微信 createInnerAudioContext 接口类型参数更新 (NervJS#15119)
Browse files Browse the repository at this point in the history
* fix:  微信createInnerAudioContext 接口类型

* fix: add supported note

* Update audio.d.ts

* Update audio.d.ts

---------

Co-authored-by: jinhaidi <jinhaidi@laiye.com>
Co-authored-by: Zakary <zakarycode@gmail.com>
  • Loading branch information
3 people authored Jan 20, 2024
1 parent bcf77a0 commit 39c4dba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/taro/types/api/media/audio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) 接口**
Expand Down Expand Up @@ -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) 接口**
Expand Down

0 comments on commit 39c4dba

Please sign in to comment.