Expand description
§spiel
Read and write audio, as well as mixed audio/events streams using the Spiel speech synthesis protocol.
§Cargo Features
Note that features with an unmarked checkbox are not yet implemented.
-
default: none. This includes all basic protocol functionality, both from bytes and into bytes:no_stdandno_alloc. This feature set requires onlycore. -
client:std, and pulls in thezbuscrate. This provides aClientproxy type that ask for the speech provider to synthesize some speech, as well as query which voices and options are available. -
reader:alloc. This gives you a sans-ioReadertype where you can [Reader::push] bytes into the buffer, and then [Reader::try_read] to the conversion into aMessage.- This is almost zero-copy. But currently requires a clone of the string if an event sent from the synthesizer has a name.
-
alloc: pulls in thebytes, ifserdeis enabled. It exposes new types like [crate::MessageOwned] and [crate::EventOwned], which are owned versions ofcrate::Messageandcrate::Event. -
poll: add wrapper functions that returnPoll::Pendingwhen there is not enough data in the buffer. This is not for general use, but rather only if you are creating an async integration. -
serde: activate [serde::Serialize] and [serde::Deserialize] on all types. -
provider: activates [std] and pulls in thezbuscrate. This will provide theSpeechProviderstruct, which can be used to provide speech over the Spiel protocol viaDBus.
§MSRV
We use the str::from_utf8 which was introduced in Rust 1.87; with no features enabled, this is our MSRV.
With other features, YMMV.
§License
All contributions are dual-licensed under MIT or Apache-2.0. This crate is suitable for proprietary text-to-speech synthesizers wanting to be providers on the Spiel interface.
Structs§
Enums§
- Chunk
Type - Error
- Event
Type - Message
- Message
Type - A type for interpreting buffer data, instead of taking references to the underlying data. This is for when the data is on your stack, and you want to borrow the results yourself.
Functions§
- read_
message read_messagetakes a buffer and triees to read aMessagefrom it. This borrows data from the buffer, then returns a tuple containing:- read_
message_ type read_message_typeallows you to get references to the input slice instead of placing it into aMessage.- write_
message - Write a message to the buffer.