Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
06e4b87c
Commit
06e4b87c
authored
Jun 07, 2024
by
Timothy J. Baek
Browse files
refac: audio
parent
c6b74a3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
src/lib/components/admin/Settings/Audio.svelte
src/lib/components/admin/Settings/Audio.svelte
+1
-1
src/lib/components/chat/MessageInput.svelte
src/lib/components/chat/MessageInput.svelte
+9
-7
No files found.
src/lib/components/admin/Settings/Audio.svelte
View file @
06e4b87c
...
@@ -125,7 +125,7 @@
...
@@ -125,7 +125,7 @@
bind:value={STT_ENGINE}
bind:value={STT_ENGINE}
placeholder="Select an engine"
placeholder="Select an engine"
>
>
<option value="">{$i18n.t('
Local
Whisper')}</option>
<option value="">{$i18n.t('Whisper
(Local)
')}</option>
<option value="openai">OpenAI</option>
<option value="openai">OpenAI</option>
<option value="web">{$i18n.t('Web API')}</option>
<option value="web">{$i18n.t('Web API')}</option>
</select>
</select>
...
...
src/lib/components/chat/MessageInput.svelte
View file @
06e4b87c
...
@@ -909,18 +909,20 @@
...
@@ -909,18 +909,20 @@
return;
return;
}
}
if ($config.audio.stt.engine === 'web') {
toast.error(
$i18n.t('Call feature is not supported when using Web STT engine')
);
return;
}
// check if user has access to getUserMedia
// check if user has access to getUserMedia
try {
try {
await navigator.mediaDevices.getUserMedia({ audio: true, video: true });
await navigator.mediaDevices.getUserMedia({ audio: true, video: true });
// If the user grants the permission, proceed to show the call overlay
// If the user grants the permission, proceed to show the call overlay
if ($config.audio.stt.engine !== 'web') {
showCallOverlay.set(true);
showCallOverlay.set(true);
} else {
toast.error(
$i18n.t('Call feature is not supported when using Web STT engine')
);
}
} catch (err) {
} catch (err) {
// If the user denies the permission or an error occurs, show an error message
// If the user denies the permission or an error occurs, show an error message
toast.error($i18n.t('Permission denied when accessing media devices'));
toast.error($i18n.t('Permission denied when accessing media devices'));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment