1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-11-23 00:39:37 +00:00

Fix errors on stable toolchain

This commit is contained in:
Bear-03 2022-07-22 18:03:01 +02:00
parent 9cd66c0358
commit 87cf05f78e
No known key found for this signature in database
GPG Key ID: 3D1DC5AFDA57B32E

View File

@ -148,10 +148,13 @@ impl WinRt {
self.synth.Options()?.SetAudioVolume(self.volume.into())?; self.synth.Options()?.SetAudioVolume(self.volume.into())?;
self.synth.SetVoice(&self.voice)?; self.synth.SetVoice(&self.voice)?;
let synth_stream = self.synth.SynthesizeTextToStreamAsync(text)?.get()?; let synth_stream = self
.synth
.SynthesizeTextToStreamAsync(&text.into())?
.get()?;
let size = synth_stream.Size()?; let size = synth_stream.Size()?;
let data_reader = DataReader::CreateDataReader(synth_stream.GetInputStreamAt(0)?)?; let data_reader = DataReader::CreateDataReader(&synth_stream.GetInputStreamAt(0)?)?;
let mut bytes = vec![0; size as usize]; let mut bytes = vec![0; size as usize];
data_reader.LoadAsync(size as u32)?.get()?; data_reader.LoadAsync(size as u32)?.get()?;
data_reader.ReadBytes(&mut bytes)?; data_reader.ReadBytes(&mut bytes)?;
@ -218,7 +221,7 @@ impl Backend for WinRt {
data_writer.StoreAsync()?; data_writer.StoreAsync()?;
data_writer.FlushAsync()?; data_writer.FlushAsync()?;
let source = MediaSource::CreateFromStream(stream, content_type)?; let source = MediaSource::CreateFromStream(&stream, &content_type)?;
self.player.SetSource(&source)?; self.player.SetSource(&source)?;
self.player.Play()?; self.player.Play()?;