diff --git a/package.json b/package.json index aaa8478..0a80fb1 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "bent": "^7.3.12", "https-proxy-agent": "^4.0.0", "simple-lru-cache": "0.0.2", - "url-parse": "^1.5.6", + "url-parse": "^1.5.10", "uuid": "^8.3.0", "ws": "^7.5.6" }, diff --git a/src/common.speech/SpeechContext.ts b/src/common.speech/SpeechContext.ts index c20f26f..de210a9 100644 --- a/src/common.speech/SpeechContext.ts +++ b/src/common.speech/SpeechContext.ts @@ -49,10 +49,10 @@ export class SpeechContext { format: {} }; } - if (this.privContext.phraseOutput.detailed === undefined) { + if (this.privContext.phraseOutput.detailed === undefined) { this.privContext.phraseOutput.detailed = { options: [] - }, + }; } this.privContext.phraseOutput.format = "Detailed"; this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment"); diff --git a/src/sdk/Audio/SpeakerAudioDestination.ts b/src/sdk/Audio/SpeakerAudioDestination.ts index 6e40d9a..f92a4d4 100644 --- a/src/sdk/Audio/SpeakerAudioDestination.ts +++ b/src/sdk/Audio/SpeakerAudioDestination.ts @@ -174,19 +174,25 @@ export class SpeakerAudioDestination implements IAudioDestination, IPlayer { } public get volume(): number { - return this.privAudio.volume; + return this.privAudio?.volume ?? -1; } public set volume(volume: number) { - this.privAudio.volume = volume; + if (!!this.privAudio) { + this.privAudio.volume = volume; + } } public mute(): void { - this.privAudio.muted = true; + if (!!this.privAudio) { + this.privAudio.muted = true; + } } public unmute(): void { - this.privAudio.muted = false; + if (!!this.privAudio) { + this.privAudio.muted = false; + } } public get isClosed(): boolean {