2 unstable releases
new 0.2.0 | Jul 15, 2025 |
---|---|
0.1.0 | Jun 6, 2025 |
#576 in Audio
42KB
990 lines
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_std
andno_alloc
. This feature set requires onlycore
. -
client
:std
, and pulls in thezbus
crate. This provides aClient
proxy 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-ioReader
type where you canReader::push
bytes into the buffer, and thenReader::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
, ifserde
is enabled. It exposes new types likecrate::MessageOwned
andcrate::EventOwned
, which are owned versions ofcrate::Message
andcrate::Event
. -
poll
: add wrapper functions that returnPoll::Pending
when 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
: activateserde::Serialize
andserde::Deserialize
on all types. -
provider
: activates [std
] and pulls in thezbus
crate. This will provide theSpeechProvider
struct, 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.
Dependencies
~0–10MB
~118K SLoC