pub trait PushAudioOutputStreamCallbacks: Send {
fn write(&mut self, data_buffer: &[u8]) -> u32;
fn close(&mut self);
}
Expand description
This trait that must be implemented by callback struct
passed into push audio output stream during initialization.
Methods of this trait will be called by Speech Synthetizer.
When Synthetizer has syntehtized data it
will call write method.
Structs implementing
PushAudioOutputStreamCallbacks must also implement Send trait.
To see how to use see example: synthesizer/speak_ssml_async.
Required Methods
called by synthetizer when new data are synthetized callback implementation should then write data to target sink (whatever it is) as appropriate It should return number of received bytes (in most cases it will return data_buffer.len())