mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-11 15:47:06 +08:00
fix: 音效垃圾清理
This commit is contained in:
parent
0a9457caf4
commit
704a23254a
@ -93,8 +93,10 @@ export class SoundPlayer<
|
||||
route.addEffect([stereo, this.gain]);
|
||||
this.player.addRoute(`sounds.${soundNum}`, route);
|
||||
route.play();
|
||||
// 清理垃圾
|
||||
source.output.addEventListener('ended', () => {
|
||||
this.playing.delete(soundNum);
|
||||
this.player.removeRoute(`sounds.${soundNum}`);
|
||||
});
|
||||
this.playing.add(soundNum);
|
||||
return soundNum;
|
||||
|
@ -146,7 +146,7 @@ export class AudioStreamSource extends AudioSource implements IStreamReader {
|
||||
logger.error(
|
||||
25,
|
||||
[...toCheck]
|
||||
.map(v => v.toString().padStart(2, '0'))
|
||||
.map(v => v.toString(16).padStart(2, '0'))
|
||||
.join(' ')
|
||||
.toUpperCase()
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user