音效报错

index.js:174889 Uncaught TypeError: Cannot read properties of null (reading ‘duration’)
at checkEnded (index.js:174889:92)

在播放音效时 _audioBuffer 为空

请问有人遇到相同的问题吗?

撤回。。。。

方便提供个 demo 测试看看?播放的音频数过多没有释放掉??

同样遇到了

我也遇到这个问题,偶现

我也遇到這個問題~
我的解決辦法是在使用AudioSource之前都要先呼叫stop。
引擎版本: 3.4.2, 3.5.0

我的先使用stop还是会大概率出现。主要就是多个音乐来回切换

我是重新写了个类使用的

[Preview]Uncaught TypeError: Cannot read properties of null (reading ‘duration’) in
开始怀疑是音频的问,结果一搜。。果然

AudioSource要挂到节点上

AudioSource 3d 版本有人遇到频繁播放声音, 掉帧并涨内存的问题吗 ?微信小游戏测试

没有 :grinning: :grinning: :grinning: :grinning: :grinning:

以解决 :laughing: :laughing: :laughing:

:cold_sweat: 我搞了个DEMO 请大佬帮忙瞧瞧呗~https://forum.cocos.org/t/topic/137075

是在调play之前调用一次stop吗,我调用stop也会报这个错

stop 后不能立即play

延迟1帧吗?还是?

对 。。。。。。。

没遇到,3.5.2

3.6.1遇到这个问题了,把那个Play On Awake取消了就好了

1赞