This commit is contained in:
mc_fdc
2023-04-08 02:10:21 +00:00
parent 47eba2e866
commit ac61e29c3a
3 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ impl AudioQuery {
}
pub async fn synthesis(&self, speaker: i32) -> Result<Bytes> {
let data = self.restapi.synthesis(&self.audio_query, speaker).await?;
let data = self.restapi.synthesis(&self.audio_query, speaker.to_string().as_str()).await?;
Ok(data)
}
}

View File

@ -14,10 +14,10 @@ impl Client {
pub async fn create_audio_query(
&self,
text: &str,
text: &str, speaker: i32,
core_version: Option<&str>,
) -> Result<AudioQuery> {
let data: AudioQueryType = self.restapi.create_audio_query(text, core_version).await?;
let data: AudioQueryType = self.restapi.create_audio_query(text, speaker, core_version).await?;
let audio_query = AudioQuery::new(self.restapi.clone(), data);
Ok(audio_query)
}

View File

@ -24,8 +24,8 @@ impl RestAPI {
}
pub async fn create_audio_query(
&self, speaker: i32,
text: &str,
&self,
text: &str, speaker: &str,
core_version: Option<&str>,
) -> Result<AudioQueryType> {
let mut params = vec![("text", text), ("speaker", speaker)];