mirror of
https://github.com/RustAudio/rodio
synced 2024-12-04 17:29:20 +00:00
Rename dynamic_mixer.rs
This commit is contained in:
parent
689670d66c
commit
6a6e94c88e
6 changed files with 11 additions and 11 deletions
|
@ -1,10 +1,10 @@
|
|||
use rodio::dynamic_mixer;
|
||||
use rodio::mixer;
|
||||
use rodio::source::{SineWave, Source};
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
// Construct a dynamic controller and mixer, stream_handle, and sink.
|
||||
let (controller, mixer) = dynamic_mixer::mixer::<f32>(2, 44_100);
|
||||
let (controller, mixer) = mixer::mixer::<f32>(2, 44_100);
|
||||
let stream_handle =
|
||||
rodio::OutputStreamBuilder::try_default_stream().expect("open default audio stream");
|
||||
let sink = rodio::Sink::connect_new(&stream_handle.mixer());
|
||||
|
|
|
@ -165,7 +165,7 @@ mod stream;
|
|||
|
||||
pub mod buffer;
|
||||
pub mod decoder;
|
||||
pub mod dynamic_mixer;
|
||||
pub mod mixer;
|
||||
pub mod queue;
|
||||
pub mod source;
|
||||
pub mod static_buffer;
|
||||
|
|
|
@ -214,12 +214,12 @@ where
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::buffer::SamplesBuffer;
|
||||
use crate::dynamic_mixer;
|
||||
use crate::mixer;
|
||||
use crate::source::Source;
|
||||
|
||||
#[test]
|
||||
fn basic() {
|
||||
let (tx, mut rx) = dynamic_mixer::mixer(1, 48000);
|
||||
let (tx, mut rx) = mixer::mixer(1, 48000);
|
||||
|
||||
tx.add(SamplesBuffer::new(1, 48000, vec![10i16, -10, 10, -10]));
|
||||
tx.add(SamplesBuffer::new(1, 48000, vec![5i16, 5, 5, 5]));
|
||||
|
@ -235,7 +235,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn channels_conv() {
|
||||
let (tx, mut rx) = dynamic_mixer::mixer(2, 48000);
|
||||
let (tx, mut rx) = mixer::mixer(2, 48000);
|
||||
|
||||
tx.add(SamplesBuffer::new(1, 48000, vec![10i16, -10, 10, -10]));
|
||||
tx.add(SamplesBuffer::new(1, 48000, vec![5i16, 5, 5, 5]));
|
||||
|
@ -255,7 +255,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn rate_conv() {
|
||||
let (tx, mut rx) = dynamic_mixer::mixer(1, 96000);
|
||||
let (tx, mut rx) = mixer::mixer(1, 96000);
|
||||
|
||||
tx.add(SamplesBuffer::new(1, 48000, vec![10i16, -10, 10, -10]));
|
||||
tx.add(SamplesBuffer::new(1, 48000, vec![5i16, 5, 5, 5]));
|
||||
|
@ -274,7 +274,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn start_afterwards() {
|
||||
let (tx, mut rx) = dynamic_mixer::mixer(1, 48000);
|
||||
let (tx, mut rx) = mixer::mixer(1, 48000);
|
||||
|
||||
tx.add(SamplesBuffer::new(1, 48000, vec![10i16, -10, 10, -10]));
|
||||
|
|
@ -8,7 +8,7 @@ use crossbeam_channel::{Receiver, Sender};
|
|||
#[cfg(not(feature = "crossbeam-channel"))]
|
||||
use std::sync::mpsc::{Receiver, Sender};
|
||||
|
||||
use crate::dynamic_mixer::Mixer;
|
||||
use crate::mixer::Mixer;
|
||||
use crate::source::SeekError;
|
||||
use crate::{queue, source::Done, Sample, Source};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::time::Duration;
|
|||
|
||||
use cpal::FromSample;
|
||||
|
||||
use crate::dynamic_mixer::Mixer;
|
||||
use crate::mixer::Mixer;
|
||||
use crate::source::{SeekError, Spatial};
|
||||
use crate::{Sample, Sink, Source};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
|||
use std::{error, fmt};
|
||||
|
||||
use crate::decoder;
|
||||
use crate::dynamic_mixer::{mixer, Mixer, MixerSource};
|
||||
use crate::mixer::{mixer, Mixer, MixerSource};
|
||||
use crate::sink::Sink;
|
||||
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
|
||||
use cpal::{
|
||||
|
|
Loading…
Reference in a new issue