amico_hal/interface/audio.rs
1/// Trait for audio playback.
2pub trait AudioPlayer {
3 /// The error type returned by the `play` method.
4 type Error;
5
6 /// Play an audio file.
7 fn play(path: &str) -> impl Future<Output = Result<(), Self::Error>> + Send + Sync
8 where
9 Self: Sized;
10}
11
12/// Trait for audio recording.
13pub trait AudioRecorder {
14 /// The error type returned by the `record` method.
15 type Error;
16
17 /// Record audio to a file.
18 fn record(path: &str) -> impl Future<Output = Result<(), Self::Error>> + Send + Sync
19 where
20 Self: Sized;
21}