Skip to content

Commit

Permalink
audio: enable voice positional for VR only
Browse files Browse the repository at this point in the history
  • Loading branch information
xesf committed Aug 6, 2023
1 parent ecc3b8c commit dffdf53
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/game/Actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,9 @@ export default class Actor {
if (this.sound) {
this.threeObject.add(this.sound);
}
// if (this.soundVoice) {
// this.threeObject.add(this.soundVoice);
// }
if (this.game.vr && this.soundVoice) {
this.threeObject.add(this.soundVoice);
}
}
if (params.editor) {
createActorLabel(this, name, this.scene.is3DCam);
Expand Down Expand Up @@ -798,19 +798,19 @@ export default class Actor {

playVoice(index: number, textBankId: number, onEndedCallback = null) {
const audio = this.game.getAudioManager();
// if (this.game.getState().config.positionalAudio) {
// audio.playSoundVoice(this.soundVoice, index, textBankId, onEndedCallback);
// return;
// }
if (this.game.vr && this.game.getState().config.positionalAudio) {
audio.playSoundVoice(this.soundVoice, index, textBankId, onEndedCallback);
return;
}
audio.playVoice(index, textBankId, onEndedCallback);
}

stopVoice() {
const audio = this.game.getAudioManager();
// if (this.game.getState().config.positionalAudio) {
// audio.stopSound(this.soundVoice);
// return;
// }
if (this.game.vr && this.game.getState().config.positionalAudio) {
audio.stopSound(this.soundVoice);
return;
}
audio.stopVoice();
}

Expand Down

0 comments on commit dffdf53

Please sign in to comment.