feat(stage-pocket): improve permission management (#2184)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: LemonNeko <17664845+LemonNekoGH@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
LemonNeko
parent
5addb1574f
commit
584e4960e9
@@ -38,8 +38,9 @@ const providerStore = useProviderConfigStore()
|
||||
const { configuredTranscriptionProvidersMetadata } = storeToRefs(providersStore)
|
||||
|
||||
const { trackProviderClick } = useAnalytics()
|
||||
const { stopStream, startStream } = useSettingsAudioDevice()
|
||||
const { audioInputs, selectedAudioInput, stream } = storeToRefs(useSettingsAudioDevice())
|
||||
const settingsAudioDeviceStore = useSettingsAudioDevice()
|
||||
const { askPermission, stopStream, startStream } = settingsAudioDeviceStore
|
||||
const { audioInputOptions, selectedAudioInput, stream } = storeToRefs(settingsAudioDeviceStore)
|
||||
const { startRecord, stopRecord, onStopRecord } = useAudioRecorder(stream)
|
||||
const { startAnalyzer, stopAnalyzer, onAnalyzerUpdate, volumeLevel } = useAudioAnalyzer()
|
||||
const { audioContext } = storeToRefs(useAudioContext())
|
||||
@@ -525,8 +526,8 @@ watch(activeTranscriptionProvider, async (provider) => {
|
||||
}, { immediate: true })
|
||||
|
||||
onMounted(async () => {
|
||||
// Audio devices are loaded on demand when user requests them
|
||||
syncOpenAICompatibleSettings()
|
||||
await askPermission()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -556,10 +557,7 @@ onUnmounted(() => {
|
||||
v-model="selectedAudioInput"
|
||||
label="Audio Input Device"
|
||||
description="Select the audio input device for your hearing module."
|
||||
:options="audioInputs.map(input => ({
|
||||
label: input.label || input.deviceId,
|
||||
value: input.deviceId,
|
||||
}))"
|
||||
:options="audioInputOptions"
|
||||
placeholder="Select an audio input device"
|
||||
layout="vertical"
|
||||
/>
|
||||
|
||||
+6
-9
@@ -113,15 +113,15 @@ const isWebSpeechAPIAvailable = computed(() => {
|
||||
&& ('webkitSpeechRecognition' in window || 'SpeechRecognition' in window)
|
||||
})
|
||||
|
||||
const settingsAudioDeviceStore = useSettingsAudioDevice()
|
||||
const { askPermission, stopStream, startStream } = settingsAudioDeviceStore
|
||||
const { audioInputOptions, selectedAudioInput, stream } = storeToRefs(settingsAudioDeviceStore)
|
||||
|
||||
onMounted(async () => {
|
||||
ensureProviderSettings()
|
||||
// Audio devices are loaded on demand when user requests them
|
||||
await askPermission()
|
||||
})
|
||||
|
||||
// Speech-to-Text test state (always uses Web Speech API)
|
||||
const { stopStream, startStream } = useSettingsAudioDevice()
|
||||
const { audioInputs, selectedAudioInput, stream } = storeToRefs(useSettingsAudioDevice())
|
||||
|
||||
const isTestingSTT = ref(false)
|
||||
const testTranscriptionText = ref<string>('')
|
||||
const testTranscriptionError = ref<string>('')
|
||||
@@ -405,10 +405,7 @@ onUnmounted(() => {
|
||||
v-model="selectedAudioInput"
|
||||
label="Audio Input Device"
|
||||
description="Select the audio input device for testing"
|
||||
:options="audioInputs.map(input => ({
|
||||
label: input.label || input.deviceId,
|
||||
value: input.deviceId,
|
||||
}))"
|
||||
:options="audioInputOptions"
|
||||
placeholder="Select an audio input device"
|
||||
layout="vertical"
|
||||
class="flex-1"
|
||||
|
||||
Reference in New Issue
Block a user