|
|
|
@ -44,8 +44,7 @@ pub enum VoiceType {
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Hash, PartialEq)]
|
|
|
|
|
pub struct Voice {
|
|
|
|
|
/// The name of this voice. Unique with regards to the output module it came from. Pass this to
|
|
|
|
|
/// [`Connection::set_synthesis_voice`] to use this voice.
|
|
|
|
|
/// The name of this voice. Unique with regards to the output module it came from.
|
|
|
|
|
pub name: String,
|
|
|
|
|
/// The language of this voice. Probably a BCP 47 language tag.
|
|
|
|
|
pub language: String,
|
|
|
|
@ -441,8 +440,8 @@ impl Connection {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn set_synthesis_voice<S: Into<String>>(&self, voice_name: S) -> Result<(), Error> {
|
|
|
|
|
let param = CString::new(voice_name.into()).unwrap();
|
|
|
|
|
pub fn set_synthesis_voice(&self, voice: &Voice) -> Result<(), Error> {
|
|
|
|
|
let param = CString::new(voice.name.clone()).unwrap();
|
|
|
|
|
let v = unsafe { spd_set_synthesis_voice(self.0, param.as_ptr()) };
|
|
|
|
|
c_int_to_result(v)
|
|
|
|
|
}
|
|
|
|
|