mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 23:29:27 +08:00
设置立体声时更新音频路由
This commit is contained in:
parent
a70a17b51e
commit
1209acce50
2
idea.md
2
idea.md
@ -42,6 +42,8 @@
|
|||||||
- 每个怪物加一个怪物说明
|
- 每个怪物加一个怪物说明
|
||||||
- 歌词展示系统
|
- 歌词展示系统
|
||||||
- 小地图显示框,可以选择是否显示剩余怪物数量等
|
- 小地图显示框,可以选择是否显示剩余怪物数量等
|
||||||
|
- 怪物死亡特效
|
||||||
|
- 区域名称显示特效,3D 粒子
|
||||||
|
|
||||||
### 第二章 智慧
|
### 第二章 智慧
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ export class SoundEffect extends AudioPlayer {
|
|||||||
private _stopingAll: boolean = false;
|
private _stopingAll: boolean = false;
|
||||||
private playMap: Map<AudioBufferSourceNode, number> = new Map();
|
private playMap: Map<AudioBufferSourceNode, number> = new Map();
|
||||||
|
|
||||||
stereo: boolean = false;
|
private _stereo: boolean = false;
|
||||||
|
|
||||||
gain: GainNode = AudioPlayer.ac.createGain();
|
gain: GainNode = AudioPlayer.ac.createGain();
|
||||||
panner: PannerNode | null = null;
|
panner: PannerNode | null = null;
|
||||||
@ -24,6 +24,14 @@ export class SoundEffect extends AudioPlayer {
|
|||||||
return this.gain.gain.value;
|
return this.gain.gain.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set stereo(value: boolean) {
|
||||||
|
this._stereo = value;
|
||||||
|
this.initAudio(value);
|
||||||
|
}
|
||||||
|
get stereo(): boolean {
|
||||||
|
return this._stereo;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(data: ArrayBuffer, stereo: boolean = false) {
|
constructor(data: ArrayBuffer, stereo: boolean = false) {
|
||||||
super(data);
|
super(data);
|
||||||
|
|
||||||
@ -35,10 +43,10 @@ export class SoundEffect extends AudioPlayer {
|
|||||||
this.playMap.delete(node);
|
this.playMap.delete(node);
|
||||||
});
|
});
|
||||||
this.on('update', () => {
|
this.on('update', () => {
|
||||||
this.initAudio(this.stereo);
|
this.initAudio(this._stereo);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.stereo = stereo;
|
this._stereo = stereo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user