@contentgrowth/llm-service 1.0.0 → 1.0.1
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.
|
@@ -737,6 +737,7 @@ var TapToTalk = ({
|
|
|
737
737
|
setVoiceTrigger(null);
|
|
738
738
|
}, []);
|
|
739
739
|
const customRecorder = useAudioRecorder(async (blob) => {
|
|
740
|
+
var _a2;
|
|
740
741
|
setVoiceTrigger(null);
|
|
741
742
|
setIsTranscribing(true);
|
|
742
743
|
setErrorMsg(null);
|
|
@@ -760,11 +761,13 @@ var TapToTalk = ({
|
|
|
760
761
|
} else {
|
|
761
762
|
setIsTranscribing(false);
|
|
762
763
|
}
|
|
764
|
+
(_a2 = voiceConfig == null ? void 0 : voiceConfig.onVoiceEnd) == null ? void 0 : _a2.call(voiceConfig);
|
|
763
765
|
});
|
|
764
766
|
const isListening = !!voiceTrigger || customRecorder.isRecording;
|
|
765
767
|
const isActive = isListening || isTranscribing;
|
|
766
768
|
const processingRef = (0, import_react5.useRef)(false);
|
|
767
769
|
const toggleVoice = async () => {
|
|
770
|
+
var _a2, _b, _c;
|
|
768
771
|
if (processingRef.current) {
|
|
769
772
|
console.log("[TapToTalk] toggleVoice ignored - processing");
|
|
770
773
|
return;
|
|
@@ -797,17 +800,20 @@ var TapToTalk = ({
|
|
|
797
800
|
console.log("[TapToTalk] Stopping voice...");
|
|
798
801
|
customRecorder.stop();
|
|
799
802
|
setVoiceTrigger(null);
|
|
803
|
+
(_a2 = voiceConfig == null ? void 0 : voiceConfig.onVoiceEnd) == null ? void 0 : _a2.call(voiceConfig);
|
|
800
804
|
} else {
|
|
801
805
|
console.log("[TapToTalk] Starting voice...");
|
|
802
806
|
setErrorMsg(null);
|
|
803
807
|
onFocusTarget == null ? void 0 : onFocusTarget();
|
|
804
808
|
setVoiceTrigger("click");
|
|
809
|
+
(_b = voiceConfig == null ? void 0 : voiceConfig.onVoiceStart) == null ? void 0 : _b.call(voiceConfig);
|
|
805
810
|
try {
|
|
806
811
|
await customRecorder.start();
|
|
807
812
|
} catch (e) {
|
|
808
813
|
console.error("[TapToTalk] Custom recorder failed:", e);
|
|
809
814
|
setErrorMsg("Mic access denied");
|
|
810
815
|
setVoiceTrigger(null);
|
|
816
|
+
(_c = voiceConfig == null ? void 0 : voiceConfig.onVoiceEnd) == null ? void 0 : _c.call(voiceConfig);
|
|
811
817
|
}
|
|
812
818
|
}
|
|
813
819
|
} finally {
|