mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-18 17:48:52 +08:00
feat: 获取音量大小接口
This commit is contained in:
parent
e32ffd2cc9
commit
f014befbbd
@ -78,6 +78,13 @@ export class BgmController<
|
|||||||
this.mainGain.setVolume(volume);
|
this.mainGain.setVolume(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取总音量大小
|
||||||
|
*/
|
||||||
|
getVolume() {
|
||||||
|
return this.mainGain.getVolume();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置是否启用
|
* 设置是否启用
|
||||||
* @param enabled 是否启用
|
* @param enabled 是否启用
|
||||||
|
@ -45,6 +45,13 @@ export class SoundPlayer<
|
|||||||
this.gain.setVolume(volume);
|
this.gain.setVolume(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取音量大小
|
||||||
|
*/
|
||||||
|
getVolume() {
|
||||||
|
return this.gain.getVolume();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加一个音效
|
* 添加一个音效
|
||||||
* @param id 音效名称
|
* @param id 音效名称
|
||||||
|
@ -385,8 +385,6 @@ export class AudioStreamSource extends AudioSource implements IStreamReader {
|
|||||||
this.createSourceNode(this.buffer);
|
this.createSourceNode(this.buffer);
|
||||||
this.output.start(0, when);
|
this.output.start(0, when);
|
||||||
this.playing = true;
|
this.playing = true;
|
||||||
console.log(when);
|
|
||||||
|
|
||||||
this.output.addEventListener('ended', () => {
|
this.output.addEventListener('ended', () => {
|
||||||
this.playing = false;
|
this.playing = false;
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
|
Loading…
Reference in New Issue
Block a user