A rust freedesktop sound lookup implementation
| .forgejo | ||
| benches | ||
| images | ||
| src | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| compose.yaml | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| LICENSE | ||
| README.md | ||
freedesktop-sound
This crate provides a freedesktop sound lookup implementation.
It exposes a single lookup function to find sound files based on their name and theme.
Example
Simple lookup:
The following snippet gets sound file from the default 'freedesktop' theme.
use freedesktop_sound::lookup;
let sound = lookup("bell").find();
Complex lookup
If you have specific requirements for your lookup you can use the provided builder functions:
use freedesktop_sound::lookup;
let sound = lookup("bell")
.with_theme("oxygen")
.find();
Cache:
If your application is going to repeat the same sound lookups multiple times you can use the internal cache to improve performance.
use freedesktop_sound::lookup;
let sound = lookup("bell")
.with_theme("oxygen")
.with_cache()
.find();
Running tests
To run tests, it's recommended to use docker, there are images for fhs compliant and not compliant distributions:
just test