mirror of
https://github.com/RustAudio/rodio
synced 2025-03-04 15:07:18 +00:00
Remove the play function
This commit is contained in:
parent
a23aeaa4ff
commit
188032f843
1 changed files with 3 additions and 8 deletions
11
src/lib.rs
11
src/lib.rs
|
@ -40,6 +40,7 @@ pub struct Sink {
|
|||
|
||||
impl Sink {
|
||||
/// Builds a new `Sink`.
|
||||
#[inline]
|
||||
pub fn new(endpoint: &Endpoint) -> Sink {
|
||||
Sink {
|
||||
handle: ENGINE.start(&endpoint),
|
||||
|
@ -48,6 +49,7 @@ impl Sink {
|
|||
}
|
||||
|
||||
/// Appends a sound to the queue of sounds to play.
|
||||
#[inline]
|
||||
pub fn append<S>(&self, source: S) where S: Source + Send + 'static,
|
||||
S::Item: Sample, S::Item: Send
|
||||
{
|
||||
|
@ -100,14 +102,7 @@ pub fn play_once<R>(endpoint: &Endpoint, input: R) -> Sink
|
|||
where R: Read + Seek + Send + 'static
|
||||
{
|
||||
let input = decoder::Decoder::new(input);
|
||||
play(endpoint, input)
|
||||
}
|
||||
|
||||
/// Plays a sound.
|
||||
pub fn play<S>(endpoint: &Endpoint, source: S) -> Sink where S: Source + Send + 'static,
|
||||
S::Item: Sample, S::Item: Send
|
||||
{
|
||||
let sink = Sink::new(endpoint);
|
||||
sink.append(source);
|
||||
sink.append(input);
|
||||
sink
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue