This commit is contained in:
tuna2134
2024-09-13 09:12:47 +00:00
parent 073ae6f952
commit 33d467f0fe
2 changed files with 7 additions and 6 deletions

View File

@@ -83,7 +83,11 @@ pub fn synthesize(
.to_owned();
Ok(Array3::from_shape_vec(
(audio_array.shape()[0], audio_array.shape()[1], audio_array.shape()[2]),
(
audio_array.shape()[0],
audio_array.shape()[1],
audio_array.shape()[2],
),
audio_array.into_raw_vec_and_offset().0,
)?)
}

View File

@@ -1,7 +1,7 @@
use crate::error::{Error, Result};
use crate::{bert, jtalk, model, nlp, norm, style, tokenizer, utils};
use ndarray::{concatenate, s, Array, Array1, Array2, Array3, Axis};
use hound::{SampleFormat, WavSpec, WavWriter};
use ndarray::{concatenate, s, Array, Array1, Array2, Array3, Axis};
use ort::Session;
use std::io::{Cursor, Read};
use tar::Archive;
@@ -231,10 +231,7 @@ impl TTSModelHolder {
}
concatenate(
Axis(0),
&audios
.iter()
.map(|x| x.view())
.collect::<Vec<_>>()
&audios.iter().map(|x| x.view()).collect::<Vec<_>>(),
)?
} else {
let (bert_ori, phones, tones, lang_ids) = self.parse_text(text)?;