Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
1df00952e4 | |||
db43d95cf7 | |||
89fcced31e | |||
1c11f279ec | |||
f854e386a6 | |||
1ba40e898b | |||
|
bcf7025f14 | ||
2239c2539a | |||
2ea85bc1bd | |||
0efdccc9aa | |||
e770c73e67 | |||
|
8ff6902148 | ||
|
29f990e19b | ||
6a6bc3f805 | |||
a50a6a4bdd | |||
d6f9043e60 | |||
4e1b79cb84 | |||
8c69d78411 | |||
0ba2937a8a | |||
be9e4592ec | |||
6aacce2d73 | |||
bbae5dc983 | |||
c6b90a7a24 | |||
ee6aba7a97 | |||
36f82b78f3 | |||
729aaf5255 | |||
2618393758 | |||
82090cb48d | |||
3709573305 | |||
911e98d9ec | |||
8434bfca64 | |||
0dc9205b36 | |||
|
143147036c | ||
2879284030 | |||
5dfc99c6d7 | |||
|
83b1ac5a76 | ||
|
7d3edccdda | ||
91098c0f01 | |||
|
675b569b32 | ||
e0170aa011 | |||
3b025dc0f9 | |||
|
67a8c19410 | ||
ac12fb132e | |||
4c8521ccb8 | |||
006a4835be | |||
5349a0fc3d | |||
7f952f2f34 | |||
f71e4b0d19 | |||
8b28fed8e5 | |||
bf348af84f | |||
e022973c8e | |||
ca2e0ffe5e | |||
0de61beafe | |||
0f06715c39 |
27
.drone.yml
Normal file
27
.drone.yml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: test
|
||||||
|
image: rust
|
||||||
|
commands:
|
||||||
|
- rustup component add clippy rustfmt
|
||||||
|
- apt-get update -qq
|
||||||
|
- apt-get install -qqy llvm-dev libclang-dev clang libspeechd-dev
|
||||||
|
- cargo fmt --all --check
|
||||||
|
- cargo test --no-default-features --features 0_10
|
||||||
|
- cargo clippy --no-default-features --features 0_10
|
||||||
|
- name: release
|
||||||
|
image: rust
|
||||||
|
commands:
|
||||||
|
- apt-get update -qq
|
||||||
|
- apt-get install -qqy llvm-dev libclang-dev clang libspeechd-dev
|
||||||
|
- cargo publish --no-default-features --features 0_10 --manifest-path speech-dispatcher-sys/Cargo.toml || true
|
||||||
|
- cargo publish --no-default-features --features 0_10 --manifest-path speech-dispatcher/Cargo.toml
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/tags/v*
|
||||||
|
environment:
|
||||||
|
CARGO_REGISTRY_TOKEN:
|
||||||
|
from_secret: cargo_registry_token
|
|
@ -1,26 +0,0 @@
|
||||||
image: rust
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- test
|
|
||||||
- publish
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y libclang-3.9-dev libspeechd-dev
|
|
||||||
- export CPATH=/usr/lib/llvm-3.9/lib/clang/3.9.1/include/
|
|
||||||
|
|
||||||
test:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- cargo test
|
|
||||||
|
|
||||||
publish:
|
|
||||||
stage: publish
|
|
||||||
script:
|
|
||||||
- cargo login $CARGO_TOKEN
|
|
||||||
- cargo package --manifest-path speech-dispatcher-sys/Cargo.toml
|
|
||||||
- cargo publish --manifest-path speech-dispatcher-sys/Cargo.toml
|
|
||||||
- cargo package --manifest-path speech-dispatcher/Cargo.toml
|
|
||||||
- cargo publish --manifest-path speech-dispatcher/Cargo.toml
|
|
||||||
only:
|
|
||||||
- tags
|
|
60
cliff.toml
Normal file
60
cliff.toml
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
# configuration file for git-cliff (0.1.0)
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
# changelog header
|
||||||
|
header = """
|
||||||
|
# Changelog\n
|
||||||
|
All notable changes to this project will be documented in this file.\n
|
||||||
|
"""
|
||||||
|
# template for the changelog body
|
||||||
|
# https://tera.netlify.app/docs/#introduction
|
||||||
|
body = """
|
||||||
|
{% if version %}\
|
||||||
|
## Version {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||||
|
{% else %}\
|
||||||
|
## Unreleased
|
||||||
|
{% endif %}\
|
||||||
|
{% for group, commits in commits | group_by(attribute="group") %}
|
||||||
|
### {{ group | upper_first }}
|
||||||
|
{% for commit in commits %}
|
||||||
|
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}\n
|
||||||
|
"""
|
||||||
|
# remove the leading and trailing whitespace from the template
|
||||||
|
trim = true
|
||||||
|
# changelog footer
|
||||||
|
footer = """
|
||||||
|
<!-- generated by git-cliff -->
|
||||||
|
"""
|
||||||
|
|
||||||
|
[git]
|
||||||
|
# parse the commits based on https://www.conventionalcommits.org
|
||||||
|
conventional_commits = true
|
||||||
|
# filter out the commits that are not conventional
|
||||||
|
filter_unconventional = true
|
||||||
|
# regex for parsing and grouping commits
|
||||||
|
commit_parsers = [
|
||||||
|
{ message = "^feat", group = "Features"},
|
||||||
|
{ message = "^fix", group = "Bug Fixes"},
|
||||||
|
{ message = "^doc", group = "Documentation"},
|
||||||
|
{ message = "^perf", group = "Performance"},
|
||||||
|
{ message = "^refactor", group = "Refactor"},
|
||||||
|
{ message = "^style", group = "Styling"},
|
||||||
|
{ message = "^test", group = "Testing"},
|
||||||
|
{ message = "^chore\\(release\\): prepare for", skip = true},
|
||||||
|
{ message = "^chore", group = "Miscellaneous Tasks"},
|
||||||
|
{ body = ".*security", group = "Security"},
|
||||||
|
]
|
||||||
|
# filter out the commits that are not matched by commit parsers
|
||||||
|
filter_commits = false
|
||||||
|
# glob pattern for matching git tags
|
||||||
|
tag_pattern = "v[0-9]*"
|
||||||
|
# regex for skipping tags
|
||||||
|
skip_tags = ""
|
||||||
|
# regex for ignoring tags
|
||||||
|
ignore_tags = ""
|
||||||
|
# sort the tags chronologically
|
||||||
|
date_order = false
|
||||||
|
# sort the commits inside sections by oldest/newest order
|
||||||
|
sort_commits = "oldest"
|
|
@ -1,11 +1,17 @@
|
||||||
[package]
|
[package]
|
||||||
name = "speech-dispatcher-sys"
|
name = "speech-dispatcher-sys"
|
||||||
version = "0.4.2"
|
version = "0.7.0"
|
||||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
||||||
repository = "https://gitlab.com/ndarilek/speech-dispatcher-rs"
|
repository = "https://dev.thewordnerd.info/nolan/speech-dispatcher-rs"
|
||||||
description = "speech-dispatcher system bindings"
|
description = "speech-dispatcher system bindings"
|
||||||
license = "LGPL-2.1"
|
license = "LGPL-2.1 OR MIT OR Apache-2.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
bindgen = "0.52"
|
bindgen = ">= 0.54"
|
||||||
gcc = "0.3"
|
|
||||||
|
[package.metadata.release]
|
||||||
|
tag-prefix = ""
|
||||||
|
publish = false
|
||||||
|
push = false
|
||||||
|
pre-release-hook = ["git-cliff", "-o", "CHANGELOG.md", "--tag", "{{version}}"]
|
||||||
|
|
|
@ -18,6 +18,7 @@ fn main() {
|
||||||
.constified_enum_module("SPDSpelling")
|
.constified_enum_module("SPDSpelling")
|
||||||
.use_core()
|
.use_core()
|
||||||
.layout_tests(false)
|
.layout_tests(false)
|
||||||
.generate().unwrap()
|
.generate()
|
||||||
|
.unwrap()
|
||||||
.write_to_file(Path::new(&out_dir).join("speech_dispatcher_sys.rs"));
|
.write_to_file(Path::new(&out_dir).join("speech_dispatcher_sys.rs"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,29 @@
|
||||||
[package]
|
[package]
|
||||||
name = "speech-dispatcher"
|
name = "speech-dispatcher"
|
||||||
version = "0.4.3"
|
version = "0.16.0"
|
||||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
||||||
repository = "https://gitlab.com/ndarilek/speech-dispatcher-rs"
|
repository = "https://dev.thewordnerd.info/nolan/speech-dispatcher-rs"
|
||||||
description = "Rusty interface to the speech-dispatcher speech synthesis library"
|
description = "Rusty interface to the speech-dispatcher speech synthesis library"
|
||||||
license = "LGPL-2.1"
|
license = "LGPL-2.1 OR MIT OR Apache-2.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
0_11 = ["0_10"]
|
||||||
|
0_10 = []
|
||||||
|
0_9 = []
|
||||||
|
default = ["0_11"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
speech-dispatcher-sys = { version = "0.4", path = "../speech-dispatcher-sys" }
|
lazy_static = "1"
|
||||||
|
speech-dispatcher-sys = { version = "0.7", path = "../speech-dispatcher-sys" }
|
||||||
|
libc = "0.2.125"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
no-default-features = true
|
||||||
|
features = ["0_9"]
|
||||||
|
|
||||||
|
[package.metadata.release]
|
||||||
|
tag-prefix = ""
|
||||||
|
publish = false
|
||||||
|
push = false
|
||||||
|
pre-release-hook = ["git-cliff", "-o", "CHANGELOG.md", "--tag", "{{version}}"]
|
||||||
|
|
42
speech-dispatcher/examples/clone_drop.rs
Normal file
42
speech-dispatcher/examples/clone_drop.rs
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
use speech_dispatcher::*;
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
let connection = speech_dispatcher::Connection::open(
|
||||||
|
"hello_world",
|
||||||
|
"hello_world",
|
||||||
|
"hello_world",
|
||||||
|
Mode::Threaded,
|
||||||
|
)?;
|
||||||
|
connection.on_begin(Some(Box::new(|msg_id, client_id| {
|
||||||
|
println!("Beginning {} from {}", msg_id, client_id)
|
||||||
|
})));
|
||||||
|
connection.on_end(Some(Box::new(|msg_id, client_id| {
|
||||||
|
println!("Ending {} from {}", msg_id, client_id)
|
||||||
|
})));
|
||||||
|
let connection_clone = connection.clone();
|
||||||
|
drop(connection);
|
||||||
|
connection_clone.say(
|
||||||
|
Priority::Important,
|
||||||
|
format!(
|
||||||
|
"Hello, world at rate {} from client {}.",
|
||||||
|
connection_clone.get_voice_rate(),
|
||||||
|
connection_clone.client_id()
|
||||||
|
),
|
||||||
|
);
|
||||||
|
connection_clone.set_voice_rate(100)?;
|
||||||
|
connection_clone.say(Priority::Important, "This is faster.");
|
||||||
|
connection_clone.set_voice_rate(0)?;
|
||||||
|
connection_clone.set_spelling(true)?;
|
||||||
|
connection_clone.say(Priority::Important, "This is spelled.");
|
||||||
|
connection_clone.set_spelling(false)?;
|
||||||
|
connection_clone.set_punctuation(Punctuation::All)?;
|
||||||
|
connection_clone.say(
|
||||||
|
Priority::Important,
|
||||||
|
"This statement, unlike others, has punctuation that is spoken!",
|
||||||
|
);
|
||||||
|
connection_clone.set_punctuation(Punctuation::None)?;
|
||||||
|
let mut _input = String::new();
|
||||||
|
io::stdin().read_line(&mut _input).unwrap();
|
||||||
|
Ok(())
|
||||||
|
}
|
|
@ -1,28 +1,40 @@
|
||||||
extern crate speech_dispatcher;
|
|
||||||
|
|
||||||
use speech_dispatcher::*;
|
use speech_dispatcher::*;
|
||||||
|
use std::io;
|
||||||
|
|
||||||
fn main() {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let connection = speech_dispatcher::Connection::open(
|
let connection = speech_dispatcher::Connection::open(
|
||||||
"hello_world",
|
"hello_world",
|
||||||
"hello_world",
|
"hello_world",
|
||||||
"hello_world",
|
"hello_world",
|
||||||
Mode::Single,
|
Mode::Threaded,
|
||||||
);
|
)?;
|
||||||
|
connection.on_begin(Some(Box::new(|msg_id, client_id| {
|
||||||
|
println!("Beginning {} from {}", msg_id, client_id)
|
||||||
|
})));
|
||||||
|
connection.on_end(Some(Box::new(|msg_id, client_id| {
|
||||||
|
println!("Ending {} from {}", msg_id, client_id)
|
||||||
|
})));
|
||||||
connection.say(
|
connection.say(
|
||||||
Priority::Important,
|
Priority::Important,
|
||||||
format!("Hello, world at rate {}.", connection.get_voice_rate()),
|
format!(
|
||||||
|
"Hello, world at rate {} from client {}.",
|
||||||
|
connection.get_voice_rate(),
|
||||||
|
connection.client_id()
|
||||||
|
),
|
||||||
);
|
);
|
||||||
connection.set_voice_rate(100);
|
connection.set_voice_rate(100)?;
|
||||||
connection.say(Priority::Important, "This is faster.");
|
connection.say(Priority::Important, "This is faster.");
|
||||||
connection.set_voice_rate(0);
|
connection.set_voice_rate(0)?;
|
||||||
connection.set_spelling(true);
|
connection.set_spelling(true)?;
|
||||||
connection.say(Priority::Important, "This is spelled.");
|
connection.say(Priority::Important, "This is spelled.");
|
||||||
connection.set_spelling(false);
|
connection.set_spelling(false)?;
|
||||||
connection.set_punctuation(Punctuation::All);
|
connection.set_punctuation(Punctuation::All)?;
|
||||||
connection.say(
|
connection.say(
|
||||||
Priority::Important,
|
Priority::Important,
|
||||||
"This statement, unlike others, has punctuation that is spoken!",
|
"This statement, unlike others, has punctuation that is spoken!",
|
||||||
);
|
);
|
||||||
connection.set_punctuation(Punctuation::None);
|
connection.set_punctuation(Punctuation::None)?;
|
||||||
|
let mut _input = String::new();
|
||||||
|
io::stdin().read_line(&mut _input).unwrap();
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
29
speech-dispatcher/examples/list_voices.rs
Normal file
29
speech-dispatcher/examples/list_voices.rs
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
use speech_dispatcher::*;
|
||||||
|
|
||||||
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
let connection = Connection::open("list_voices", "list_voices", "list_voices", Mode::Threaded)?;
|
||||||
|
|
||||||
|
let modules = connection.list_output_modules()?;
|
||||||
|
println!("Modules available: {:?}", modules);
|
||||||
|
for module in modules {
|
||||||
|
if connection.set_output_module(&module).is_ok() {
|
||||||
|
println!("Listing voices for module {module}");
|
||||||
|
} else {
|
||||||
|
println!("Failed to set output module to {module}");
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
let voices = connection.list_synthesis_voices()?;
|
||||||
|
for voice in voices {
|
||||||
|
if let Some(variant) = voice.variant {
|
||||||
|
println!(
|
||||||
|
" Name: {} / Language: {} / Variant: {variant}",
|
||||||
|
voice.name, voice.language
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
println!(" Name: {} / Language: {}", voice.name, voice.language);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use connection.set_synthesis_voice(voice) to set the voice to use.
|
||||||
|
Ok(())
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user