From f463d0f68c7dfecbbf070ff98f4e09fc4a6bb228 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Thu, 31 Mar 2022 15:19:25 +0200 Subject: [PATCH] Correct config payload --- src/vosk_client/mod.rs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/vosk_client/mod.rs b/src/vosk_client/mod.rs index dc79401..4efa32d 100644 --- a/src/vosk_client/mod.rs +++ b/src/vosk_client/mod.rs @@ -1,7 +1,20 @@ +// Copyright (C) 2022 Rafael Caricio +// +// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0. +// If a copy of the MPL was not distributed with this file, You can obtain one at +// . +// +// SPDX-License-Identifier: MPL-2.0 + use serde_derive::{Deserialize, Serialize}; #[derive(Deserialize, Serialize, Debug)] pub struct Configuration { + config: ConfigInner, +} + +#[derive(Deserialize, Serialize, Debug)] +struct ConfigInner { /// Sample rate the audio will be provided at. sample_rate: i32, @@ -12,9 +25,11 @@ pub struct Configuration { impl Configuration { pub fn new(sample_rate: i32) -> Self { Self { - sample_rate, - // We always want to receive the words with their time ranges. - words: true, + config: ConfigInner { + sample_rate, + // We always want to receive the words with their time ranges. + words: true, + }, } } } @@ -32,4 +47,4 @@ pub struct WordInfo { pub word: String, pub start: f64, pub end: f64, -} +} \ No newline at end of file