mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-29 05:24:30 +08:00
删除部分无用参数
This commit is contained in:
1 parent
c70c5b1594
commit
a70a17b51e
8 files changed
+25
-68
No files matched your search
@@ -13,6 +13,11 @@ interface AudioPlayerEvent extends EmitableEvent {
|
||||
end: (node: AudioBufferSourceNode) => void;
|
||||
}
|
||||
|
||||
export type AudioParamOf<T extends AudioNode> = Record<
|
||||
SelectKey<T, AudioParam>,
|
||||
number
|
||||
>;
|
||||
|
||||
export class AudioPlayer extends EventEmitter<AudioPlayerEvent> {
|
||||
static ac: AudioContext = ac;
|
||||
static index: number = 0;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { has } from '../../plugin/utils';
|
||||
import { AudioPlayer } from './audio';
|
||||
import { AudioParamOf, AudioPlayer } from './audio';
|
||||
import resource from '../../data/resource.json';
|
||||
|
||||
type Panner = {
|
||||
[P in SelectKey<PannerNode, AudioParam>]: number;
|
||||
};
|
||||
type Panner = AudioParamOf<PannerNode>;
|
||||
|
||||
export class SoundEffect extends AudioPlayer {
|
||||
static playIndex = 0;
|
||||
@@ -45,6 +43,11 @@ export class SoundEffect extends AudioPlayer {
|
||||
|
||||
/**
|
||||
* 设置音频路由线路
|
||||
* ```txt
|
||||
* 不启用立体声:source -> gain -> destination
|
||||
* 启用立体声:source -> panner -> gain --> destination
|
||||
* 单声道立体声:source -> merger -> panner -> gain -> destination
|
||||
* ```
|
||||
* @param stereo 是否启用立体声
|
||||
*/
|
||||
protected initAudio(stereo: boolean = false) {
|
||||
|
||||
Reference in new issue
Block a user