Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions plugins/love-resources/src/components/AddRoomPopup.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<script lang="ts">
import core, { Class, Data, generateId, type Doc, Ref } from '@hcengineering/core'
import { Floor, getFreePosition, Office, Room, RoomAccess, RoomType } from '@hcengineering/love'
import { Floor, getFreePosition, Office, Room, RoomAccess, RoomLanguage, RoomType } from '@hcengineering/love'
import { translate } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation'
import setting, { type OfficeSettings } from '@hcengineering/setting'
import { Button, DropdownIntlItem } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'
import love from '../plugin'
import { rooms, selectedFloor } from '../stores'
import { languagesDisplayData } from '../types'

function getDefaultLanguage (): RoomLanguage {
const locale = navigator.language
if (locale in languagesDisplayData) return locale as RoomLanguage
const lang = locale.split('-')[0]
return (lang in languagesDisplayData ? lang : 'en') as RoomLanguage
}

export let floor: Ref<Floor>

Expand Down Expand Up @@ -73,7 +81,7 @@
height: 1,
type: val.type,
access: val.access,
language: 'en',
language: getDefaultLanguage(),
startWithTranscription: defaultTranscription,
startWithRecording: defaultRecording,
description: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
// limitations under the License.
-->
<script lang="ts">
import { Label, ModernToggle } from '@hcengineering/ui'
import ui, { Label, ModernToggle } from '@hcengineering/ui'
import love, { Room } from '@hcengineering/love'
import { getClient } from '@hcengineering/presentation'
import RoomLanguageSelector from './RoomLanguageSelector.svelte'

export let room: Room

Expand All @@ -31,12 +32,12 @@
</script>

<div class="antiGrid">
<!-- <div class="antiGrid-row">
<div class="antiGrid-row">
<div class="antiGrid-row__header">
<Label label={ui.string.Language} />
</div>
<RoomLanguageSelector {room} />
</div> -->
</div>
<div class="antiGrid-row">
<div class="antiGrid-row__header">
<Label label={love.string.StartWithTranscription} />
Expand Down
17 changes: 8 additions & 9 deletions services/ai-bot/love-agent/src/deepgram/stt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class STT implements Stt {
private readonly deepgram: DeepgramClient

private isInProgress = false
// private language: string = 'en'
private language: string = 'multi'

private readonly trackBySid = new Map<string, RemoteTrack>()
private readonly streamBySid = new Map<string, AudioStream>()
Expand All @@ -52,12 +52,12 @@ export class STT implements Stt {
}

updateLanguage (language: string): void {
// const shouldRestart = (this.language ?? 'en') !== language
// this.language = language
// if (shouldRestart) {
// this.stop()
// this.start()
// }
const shouldRestart = this.language !== language
this.language = language
if (shouldRestart) {
this.stop()
this.start()
}
}

start (): void {
Expand Down Expand Up @@ -161,7 +161,7 @@ export class STT implements Stt {
encoding: 'linear16',
channels: stream.numChannels,
sample_rate: stream.sampleRate,
language: 'multi',
language: this.language,
model: config.DeepgramModel
}
}
Expand All @@ -172,7 +172,6 @@ export class STT implements Stt {
if (this.dgConnectionBySid.has(sid)) return

const stream = new AudioStream(track, config.DgSampleRate)
// const language = this.language ?? 'en'
const options = this.getOptions(stream)
const dgConnection = this.deepgram.listen.live(options)
console.log('Starting deepgram for track', this.room.name, sid, options)
Expand Down
Loading