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