pub struct PAT {}
Expand description
PAT Audio Technician (PAT)
Implementations§
Source§impl PAT
impl PAT
Sourcepub fn new() -> Result<PAT, PATError>
pub fn new() -> Result<PAT, PATError>
Creates a new PAT instance and initializes PAT if it has already been initialized.
§Examples
rustpat::PAT::new().unwrap();
Sourcepub fn play(&self, pat_audio_path: &str) -> Result<(), PATError>
pub fn play(&self, pat_audio_path: &str) -> Result<(), PATError>
Play an audio file.
The audio file can be a local file or remote file (http:// or https://).
§Examples
let pat = rustpat::PAT::new().unwrap();
let test_audio = format!("{}/src/libpat/test/test.ogg", env!("CARGO_MANIFEST_DIR"));
pat.play(&test_audio).unwrap();
Sourcepub fn skip(&self) -> Result<(), PATError>
pub fn skip(&self) -> Result<(), PATError>
Skip playback of the current audio file.
This method does nothing if there is not an audio file playing.
§Examples
let pat = rustpat::PAT::new().unwrap();
pat.skip().unwrap();
Auto Trait Implementations§
impl Freeze for PAT
impl RefUnwindSafe for PAT
impl Send for PAT
impl Sync for PAT
impl Unpin for PAT
impl UnwindSafe for PAT
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more