forked from Blendman974/faceclaw
Merge multilingual Whisper transcription
# Conflicts: # app/g2/dashboard-controller.ts
This commit is contained in:
17 files changed
+361
-37
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { startRemoteInput } from "../remote/service";
|
||||
import { getHeadUpPreferences,appSwitcherPositionSetting,statusBarPositionSetting,statusBarVisibilitySetting,windowBorderSetting,assistantAllowProactiveSetting,assistantBackendSetting,assistantBridgeHostSetting,assistantBridgePortSetting,assistantBridgeTokenSetting,getBrightnessPreferences,displayLayoutSetting,navigateDisplayLayoutSetting,terminalDisplayLayoutSetting,elevenLabsApiKeySetting,getStringSettingById,openAiApiKeySetting,nightscoutApiTokenSetting,firmwareDebugFlagsSetting,whisperServerApiKeySetting,whisperServerLanguageSetting,whisperServerModelSetting,whisperServerUrlSetting,lockScreenEnabledSetting,nightscoutSiteUrlSetting,onAnySettingChanged,previewColorSetting,ringConnectionModeSetting,type RingConnectionMode,saveVoiceRecordingsSetting,sonioxApiKeySetting,screenTimeoutSetting,screenTimeoutSettingToMs,suspendEvenHubWhenScreenOffSetting,voiceProviderSetting,wakeWordActionSetting,type ConfigSettingString } from "../ui/dashboard-settings";
|
||||
import { getHeadUpPreferences,appSwitcherPositionSetting,statusBarPositionSetting,statusBarVisibilitySetting,windowBorderSetting,assistantAllowProactiveSetting,assistantBackendSetting,assistantBridgeHostSetting,assistantBridgePortSetting,assistantBridgeTokenSetting,getBrightnessPreferences,displayLayoutSetting,navigateDisplayLayoutSetting,terminalDisplayLayoutSetting,elevenLabsApiKeySetting,getStringSettingById,openAiApiKeySetting,nightscoutApiTokenSetting,firmwareDebugFlagsSetting,whisperServerApiKeySetting,getVoiceTranscriptionLanguage,whisperServerModelSetting,whisperServerUrlSetting,lockScreenEnabledSetting,nightscoutSiteUrlSetting,onAnySettingChanged,previewColorSetting,ringConnectionModeSetting,type RingConnectionMode,saveVoiceRecordingsSetting,sonioxApiKeySetting,screenTimeoutSetting,screenTimeoutSettingToMs,suspendEvenHubWhenScreenOffSetting,voiceProviderSetting,wakeWordActionSetting,type ConfigSettingString } from "../ui/dashboard-settings";
|
||||
import { acceptInput, resetRingInputFilter } from "../ui/input-monitor";
|
||||
import { Application, Dialogs, ImageSource } from "@nativescript/core";
|
||||
import { EvenAIStatus, EvenAIStatusName, EventSourceType, EventSourceTypeName, OsEventTypeList, OsEventTypeName, WatchGestureType, WatchGestureTypeName } from "./events";
|
||||
@@ -485,6 +485,7 @@ class DashboardController {
|
||||
this.applyVerticalPositionIfChanged();
|
||||
this.applyAppLayoutsIfChanged();
|
||||
this.syncAssistantBridgeIfChanged();
|
||||
this.retargetContinuousCapture();
|
||||
this.syncLockScreenSettingIfChanged();
|
||||
// A Preview color or scaling change should show on the mirror at once,
|
||||
// not at the next composited frame (cheap: floor-limited, dedup'd on
|
||||
@@ -2214,14 +2215,14 @@ class DashboardController {
|
||||
private voiceCaptureOptions(communicator: FaceclawCommunicatorBridge | null) {
|
||||
// A window that needs its own provider and language sets them for every
|
||||
// capture while it is open, so push-to-talk still shares its stream.
|
||||
// Otherwise only Whisper server is told a language (its own setting).
|
||||
// Otherwise use the shared transcription-language preference.
|
||||
const choice = this.transcriptionChoice();
|
||||
const provider = choice?.provider ?? voiceProviderSetting.get();
|
||||
return {
|
||||
communicator: communicator?.getNativeCommunicator() ?? null,
|
||||
usePhoneMic: communicator === null,
|
||||
provider,
|
||||
language: choice ? choice.language : provider === "whisper-server" ? whisperServerLanguageSetting.get() : "",
|
||||
language: choice ? choice.language : getVoiceTranscriptionLanguage(provider),
|
||||
elevenLabsApiKey: elevenLabsApiKeySetting.get(),
|
||||
openAiApiKey: openAiApiKeySetting.get(),
|
||||
sonioxApiKey: sonioxApiKeySetting.get(),
|
||||
|
||||
@@ -51,7 +51,7 @@ import { mirrorToPanelFraction, phonePreviewCrop } from './phone-preview-crop'
|
||||
import { onAnySettingChanged,
|
||||
previewColorSetting, lockScreenEnabledSetting, getBrightnessPreferences, getStringSettingById,
|
||||
nightscoutSiteUrlSetting, nightscoutApiTokenSetting, voiceProviderSetting, elevenLabsApiKeySetting,
|
||||
openAiApiKeySetting, sonioxApiKeySetting, whisperServerApiKeySetting, whisperServerLanguageSetting,
|
||||
openAiApiKeySetting, sonioxApiKeySetting, whisperServerApiKeySetting, getVoiceTranscriptionLanguage,
|
||||
whisperServerModelSetting, whisperServerUrlSetting, ringConnectionModeSetting, saveTranscribeAudioSetting } from '../ui/dashboard-settings'
|
||||
import { transcriptionKey, type VoiceProviderSelection } from '../native/cloud-stt-provider'
|
||||
import type { PhoneGesture } from '../phone-ui/phone-gestures'
|
||||
@@ -398,6 +398,7 @@ export class IosPreviewController {
|
||||
const phone = readPhoneBatteryState()
|
||||
this.logBluetooth(`Phone battery ${phone.battery ?? "unknown"}% charging=${phone.charging}`)
|
||||
this.offSettings = onAnySettingChanged(() => {
|
||||
this.syncContinuousCapture()
|
||||
this.syncLockSetting()
|
||||
this.pushBrightness()
|
||||
this.relayout()
|
||||
@@ -1152,13 +1153,12 @@ export class IosPreviewController {
|
||||
/**
|
||||
* The transcription provider setting and the keys the cloud ones need. A
|
||||
* window that needs its own provider and language (Translate) sets them for
|
||||
* every capture while it is open; otherwise only Whisper server is told a
|
||||
* language (its own setting).
|
||||
* every capture while it is open; otherwise use the shared language preference.
|
||||
*/
|
||||
private voiceProvider(): VoiceProviderSelection {
|
||||
const choice = [...this.continuousClients.values()].find(options => options.transcription)?.transcription
|
||||
const provider = choice?.provider ?? voiceProviderSetting.get()
|
||||
return { provider, language: choice ? choice.language : provider === 'whisper-server' ? whisperServerLanguageSetting.get() : '',
|
||||
return { provider, language: choice ? choice.language : getVoiceTranscriptionLanguage(provider),
|
||||
elevenLabsApiKey: elevenLabsApiKeySetting.get(), openAiApiKey: openAiApiKeySetting.get(), sonioxApiKey: sonioxApiKeySetting.get(),
|
||||
whisperServerUrl: whisperServerUrlSetting.get(), whisperServerModel: whisperServerModelSetting.get(),
|
||||
whisperServerApiKey: whisperServerApiKeySetting.get() }
|
||||
|
||||
Reference in new issue
Block a user