check for privAudio for SAD mute/volume API (#486)
* check for privAudio for SAD mute/volume API * update url-parse, fix syntax issues from community PR
This commit is contained in:
Родитель
2e4639e5bc
Коммит
447962b53a
|
@ -108,7 +108,7 @@
|
||||||
"bent": "^7.3.12",
|
"bent": "^7.3.12",
|
||||||
"https-proxy-agent": "^4.0.0",
|
"https-proxy-agent": "^4.0.0",
|
||||||
"simple-lru-cache": "0.0.2",
|
"simple-lru-cache": "0.0.2",
|
||||||
"url-parse": "^1.5.6",
|
"url-parse": "^1.5.10",
|
||||||
"uuid": "^8.3.0",
|
"uuid": "^8.3.0",
|
||||||
"ws": "^7.5.6"
|
"ws": "^7.5.6"
|
||||||
},
|
},
|
||||||
|
|
|
@ -49,10 +49,10 @@ export class SpeechContext {
|
||||||
format: {}
|
format: {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (this.privContext.phraseOutput.detailed === undefined) {
|
if (this.privContext.phraseOutput.detailed === undefined) {
|
||||||
this.privContext.phraseOutput.detailed = {
|
this.privContext.phraseOutput.detailed = {
|
||||||
options: []
|
options: []
|
||||||
},
|
};
|
||||||
}
|
}
|
||||||
this.privContext.phraseOutput.format = "Detailed";
|
this.privContext.phraseOutput.format = "Detailed";
|
||||||
this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment");
|
this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment");
|
||||||
|
|
|
@ -174,19 +174,25 @@ export class SpeakerAudioDestination implements IAudioDestination, IPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public get volume(): number {
|
public get volume(): number {
|
||||||
return this.privAudio.volume;
|
return this.privAudio?.volume ?? -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public set volume(volume: number) {
|
public set volume(volume: number) {
|
||||||
this.privAudio.volume = volume;
|
if (!!this.privAudio) {
|
||||||
|
this.privAudio.volume = volume;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public mute(): void {
|
public mute(): void {
|
||||||
this.privAudio.muted = true;
|
if (!!this.privAudio) {
|
||||||
|
this.privAudio.muted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public unmute(): void {
|
public unmute(): void {
|
||||||
this.privAudio.muted = false;
|
if (!!this.privAudio) {
|
||||||
|
this.privAudio.muted = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public get isClosed(): boolean {
|
public get isClosed(): boolean {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче