| Crates.io | freedesktop-sound |
| lib.rs | freedesktop-sound |
| version | 0.1.0 |
| created_at | 2025-04-07 13:47:40.36741+00 |
| updated_at | 2025-04-07 13:47:40.36741+00 |
| description | A Freedesktop Sound lookup crate |
| homepage | |
| repository | https://github.com/unixpariah/freedestkop-sound |
| max_upload_size | |
| id | 1624150 |
| size | 42,088 |
This crate provides a freedesktop sound lookup implementation.
It exposes a single lookup function to find sound files based on their name and theme.
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("firefox")
.with_theme("oxygen")
.with_cache()
.find();
To run tests, it's recommended to use Docker Compose, which offers images for fhs compliant and not compliant distributions:
docker compose up