mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-09 17:05:01 +00:00
Add sample rate to config (#8797)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
93a957275c
commit
ee99e76bb6
@ -35,7 +35,8 @@ interface Config {
|
||||
DgVadEvents: boolean
|
||||
DgPunctuate: boolean
|
||||
DgSmartFormat: boolean
|
||||
DgNoDelay: boolean
|
||||
DgNoDelay: boolean,
|
||||
DgSampleRate: number
|
||||
}
|
||||
|
||||
const config: Config = (() => {
|
||||
@ -59,7 +60,8 @@ const config: Config = (() => {
|
||||
DgPunctuate: process.env.DG_PUNCTUATE === 'true',
|
||||
DgSmartFormat: process.env.DG_SMART_FORMAT === 'true',
|
||||
DgUtteranceEndMs: parseInt(process.env.DG_UTTERANCE_END_MS ?? '0'),
|
||||
DgNoDelay: process.env.DG_NO_DELAY === 'true'
|
||||
DgNoDelay: process.env.DG_NO_DELAY === 'true',
|
||||
DgSampleRate: parseInt(process.env.DG_SAMPLE_RATE ?? '16000')
|
||||
}
|
||||
|
||||
const missingEnv = (Object.keys(params) as Array<keyof Config>).filter((key) => params[key] === undefined)
|
||||
|
@ -167,7 +167,7 @@ export class STT implements Stt {
|
||||
if (track === undefined) return
|
||||
if (this.dgConnectionBySid.has(sid)) return
|
||||
|
||||
const stream = new AudioStream(track)
|
||||
const stream = new AudioStream(track, config.DgSampleRate)
|
||||
// const language = this.language ?? 'en'
|
||||
const options = this.getOptions(stream)
|
||||
const dgConnection = this.deepgram.listen.live(options)
|
||||
|
Loading…
Reference in New Issue
Block a user