@unith-ai/core-client 2.0.4-beta.2 → 2.0.4-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.web.js +11 -15
- package/dist/lib.web.js.map +1 -1
- package/dist/modules/microphone.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/lib.web.js
CHANGED
|
@@ -25481,6 +25481,7 @@ var Microphone = class _Microphone {
|
|
|
25481
25481
|
this.options.onMicrophoneSpeechRecognitionResult({ transcript: text });
|
|
25482
25482
|
}
|
|
25483
25483
|
async startAzureMicrophone() {
|
|
25484
|
+
var _a, _b;
|
|
25484
25485
|
if (this.tokenObj.token.length === 0) {
|
|
25485
25486
|
const tokenObj = await this.user.getAsrToken("azure");
|
|
25486
25487
|
if (!tokenObj.region || !tokenObj.token) {
|
|
@@ -25495,21 +25496,16 @@ var Microphone = class _Microphone {
|
|
|
25495
25496
|
const speechSdk = await import("microsoft-cognitiveservices-speech-sdk").catch((err) => {
|
|
25496
25497
|
throw new Error("Azure Speech SDK not available: " + err);
|
|
25497
25498
|
});
|
|
25498
|
-
const
|
|
25499
|
-
|
|
25500
|
-
|
|
25501
|
-
AudioConfig,
|
|
25502
|
-
|
|
25503
|
-
ResultReason,
|
|
25504
|
-
|
|
25505
|
-
|
|
25506
|
-
|
|
25507
|
-
|
|
25508
|
-
AudioConfig,
|
|
25509
|
-
SpeechRecognizer
|
|
25510
|
-
});
|
|
25511
|
-
if (!SpeechConfig || !AudioConfig || !SpeechRecognizer) {
|
|
25512
|
-
throw new Error("Azure Speech SDK does not expose expected symbols.");
|
|
25499
|
+
const sdk = speechSdk;
|
|
25500
|
+
let SpeechConfig, AudioConfig, SpeechRecognizer, ResultReason, PhraseListGrammar;
|
|
25501
|
+
if (sdk.SpeechConfig) {
|
|
25502
|
+
({ SpeechConfig, AudioConfig, SpeechRecognizer, ResultReason, PhraseListGrammar } = sdk);
|
|
25503
|
+
} else if ((_a = sdk.default) == null ? void 0 : _a.SpeechConfig) {
|
|
25504
|
+
({ SpeechConfig, AudioConfig, SpeechRecognizer, ResultReason, PhraseListGrammar } = sdk.default);
|
|
25505
|
+
} else if ((_b = sdk.SpeechSDK) == null ? void 0 : _b.SpeechConfig) {
|
|
25506
|
+
({ SpeechConfig, AudioConfig, SpeechRecognizer, ResultReason, PhraseListGrammar } = sdk.SpeechSDK);
|
|
25507
|
+
} else {
|
|
25508
|
+
throw new Error("Azure Speech SDK does not expose expected symbols. Check that the package is installed correctly.");
|
|
25513
25509
|
}
|
|
25514
25510
|
const speechConfig = SpeechConfig.fromAuthorizationToken(
|
|
25515
25511
|
this.tokenObj.token,
|