Trait AudioGenerator
Source pub trait AudioGenerator {
type Error: Error + Send + Sync + 'static;
// Required method
fn generate(
&self,
prompt: &str,
) -> impl Stream<Item = Result<Data, Self::Error>> + Send;
}
Expand description
Generates audio from text prompts.
§Example
ⓘuse aither::AudioGenerator;
use futures_core::Stream;
struct MyAudioGen;
impl AudioGenerator for MyAudioGen {
fn generate(&self, prompt: &str) -> impl Stream<Item = aither::audio::Data> + Send {
futures_lite::stream::iter(Some(vec![0u8; 1024]))
}
}
The error type returned by this generator.
Generates audio from text prompt.
Returns a Stream of Data chunks. Synthesis can fail part-way
through, so each chunk is fallible rather than silently truncating the
audio on error.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".