diff --git a/src/audio_query.rs b/src/audio_query.rs index 765a9d9..0f43b7e 100644 --- a/src/audio_query.rs +++ b/src/audio_query.rs @@ -16,7 +16,7 @@ impl AudioQuery { } pub async fn synthesis(&self, speaker: i32) -> Result { - 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) } } diff --git a/src/client.rs b/src/client.rs index 27cbe77..2f805fd 100644 --- a/src/client.rs +++ b/src/client.rs @@ -14,10 +14,10 @@ impl Client { pub async fn create_audio_query( &self, - text: &str, + text: &str, speaker: i32, core_version: Option<&str>, ) -> Result { - 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) } diff --git a/src/restapi.rs b/src/restapi.rs index e1bf152..b003567 100644 --- a/src/restapi.rs +++ b/src/restapi.rs @@ -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 { let mut params = vec![("text", text), ("speaker", speaker)];