[−][src]Trait simple_tones::Play
Required methods
pub fn play(&self, stream_handle: &OutputStreamHandle, bar_duration: Duration)
[src]
Plays on the given stream_handle
for duration
time.
Implementations on Foreign Types
impl<'a, T> Play for &'a T where
T: Play,
[src]
T: Play,
pub fn play(&self, stream_handle: &OutputStreamHandle, bar_duration: Duration)
[src]
Implementors
impl Play for Note
[src]
pub fn play(&self, stream_handle: &OutputStreamHandle, bar_duration: Duration)
[src]
Plays this note on the given stream_handle
for duration
time. The sound is generated by a sine wave.
Example
use std::time; use simple_tones::{Note, NoteType, NotePitch, Play}; let (_stream, stream_handle) = rodio::OutputStream::try_default().unwrap(); let note = Note::new(NotePitch::new(NoteType::A, 4), 1); note.play(&stream_handle, time::Duration::from_secs(2));