Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 微信createInnerAudioContext 接口类型 #15119

Merged
merged 5 commits into from
Jan 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Jinx-1120 marked this conversation as resolved.
Show resolved Hide resolved
}
}

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
Loading