espeak-sys

Crates.ioespeak-sys
lib.rsespeak-sys
version0.0.2
sourcesrc
created_at2015-10-11 22:58:43.951358
updated_at2015-12-11 23:58:51.47213
descriptionLow-level bindings to libespeak
homepagehttps://github.com/ctatchley/espeak-sys
repositoryhttps://github.com/ctatchley/espeak-sys
max_upload_size
id3198
size39,588
(ctatchley)

documentation

README

Rust Bindings for libespeak

Following convention of crates suffixed with -sys, the crate is no more than a bottom-level wrapper for the API exposed by libespeak's header.

Dependencies

espeak-sys requires that you have libespeak somewhere on your computer where Rust's linker may find it. To ensure libespeak is installed if you have a Debian-based Linux system, simply run the command

sudo apt-get install libespeak-dev

in your terminal. libespeak may not be available, or may not be usable with this crate on platforms other than Linux.

Usage

Just add espeak-sys as a dependency in Cargo.toml and link to it within your crate:

[dependencies]
espeak-sys = "0.0.1"
extern crate espeak_sys;

Usage of the crate is as simple as using the provided functions as they are defined in libespeak's header file, with a few caveats. Namely, the type field of the espeak_EVENT struct is renamed to event_type, as the former is a reserved keyword in Rust. Additionally, due to the lack of a one-to-one correspondence for C's union types, the id field is represented by a mere u64 that the crate's user is expected to mercilessly transmute to the desired type variant. Since id's type is dependent on the value of event_type, it should still be possible to build a safe wrapper upon the struct.

Finding Help

The function of each of the symbols this crate exposes is best documented in the C header file:

License

Copyright © 2015 Chandler Atchley

Distributed under the MIT License.

Commit count: 11

cargo fmt