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

抽奖音效和中奖音效 #529

Open
kaci1129 opened this issue Dec 29, 2024 · 1 comment
Open

抽奖音效和中奖音效 #529

kaci1129 opened this issue Dec 29, 2024 · 1 comment

Comments

@kaci1129
Copy link

请问抽奖音效和中奖音效如何添加?

@cat-kun
Copy link

cat-kun commented Jan 15, 2025

onStart的时候去控制音频的播放

const innerAudioContext = wx.createInnerAudioContext({
  useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项
})
innerAudioContext.src = 'https://wx_test.mp3'

innerAudioContext.play() // 播放

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants