Correct config payload
This commit is contained in:
parent
8f85e53ca2
commit
f463d0f68c
1 changed files with 19 additions and 4 deletions
|
@ -1,7 +1,20 @@
|
|||
// Copyright (C) 2022 Rafael Caricio <rafael@caricio.com>
|
||||
//
|
||||
// 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
|
||||
// <https://mozilla.org/MPL/2.0/>.
|
||||
//
|
||||
// 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 {
|
||||
config: ConfigInner {
|
||||
sample_rate,
|
||||
// We always want to receive the words with their time ranges.
|
||||
words: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue