Compare commits

..

No commits in common. "704a23254a792546e0d10db711507ed7e21cecd1" and "89567924e835927c52fa8dfa5d5bb45051a0e8b5" have entirely different histories.

3 changed files with 2 additions and 6 deletions

View File

@ -150,11 +150,9 @@ export class AudioPlayer extends EventEmitter<AudioPlayerEvent> {
/** /**
* *
* ```txt
* |-----------| * |-----------|
* Input ----> | DelayNode | ----> Output * Input ----> | DelayNode | ----> Output
* |-----------| * |-----------|
* ```
*/ */
createDelay() { createDelay() {
return new DelayEffect(this.ac); return new DelayEffect(this.ac);
@ -261,7 +259,7 @@ export class AudioPlayer extends EventEmitter<AudioPlayerEvent> {
resume(id: string) { resume(id: string) {
const route = this.getRoute(id); const route = this.getRoute(id);
if (!route) { if (!route) {
logger.warn(53, 'resume', id); logger.warn(53, 'play', id);
return; return;
} }
route.resume(); route.resume();

View File

@ -93,10 +93,8 @@ 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;

View File

@ -146,7 +146,7 @@ export class AudioStreamSource extends AudioSource implements IStreamReader {
logger.error( logger.error(
25, 25,
[...toCheck] [...toCheck]
.map(v => v.toString(16).padStart(2, '0')) .map(v => v.toString().padStart(2, '0'))
.join(' ') .join(' ')
.toUpperCase() .toUpperCase()
); );