-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/RustAudio/rodio into feat…
…ure-channelbitmask
- Loading branch information
Showing
71 changed files
with
785 additions
and
640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
This guide will help you update your code when upgrading from older versions of rodio. | ||
|
||
# rodio 0.20.1 or earlier to current GitHub version | ||
|
||
## Features | ||
- If you use disable the rodio features with `default_features = false` in | ||
`Cargo.toml` you need to add a new feature `playback`. | ||
|
||
## Source implementations | ||
- Source had a required method `current_frame_len`. In the latest version of rodio *frame* has been renamed to *span*. You will need to change every occurrence of `current_frame_len` to `current_span_len`. | ||
|
||
## OutputStream | ||
- The outputstream is now more configurable. Where you used `OutputStream::try_default()` you have a choice: | ||
- *(recommended)* Get an error when the default stream could not be opened: `OutputStreamBuilder::open_default_stream()?` | ||
- Stay close to the old behavior using: | ||
`OutputStreamBuilder::open_stream_or_fallback()`, which tries to open the | ||
default (audio) stream. If that fails it tries all other combinations of | ||
device and settings. The old behavior was only trying all settings of the | ||
default device. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use cpal::FromSample; | ||
use dasp_sample::FromSample; | ||
use divan::Bencher; | ||
use rodio::Source; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use rodio::{output_to_wav, Source}; | ||
use std::error::Error; | ||
use std::io::BufReader; | ||
|
||
/// Converts mp3 file to a wav file. | ||
/// This example does not use any audio devices | ||
/// and can be used in build configurations without `cpal` feature enabled. | ||
fn main() -> Result<(), Box<dyn Error>> { | ||
let file = std::fs::File::open("assets/music.mp3")?; | ||
let mut audio = rodio::Decoder::new(BufReader::new(file))? | ||
.automatic_gain_control(1.0, 4.0, 0.005, 3.0) | ||
.speed(0.8); | ||
|
||
let wav_path = "music_mp3_converted.wav"; | ||
println!("Storing converted audio into {}", wav_path); | ||
output_to_wav(&mut audio, wav_path)?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// Stream sample rate (samples per second per channel). | ||
pub type SampleRate = u32; | ||
|
||
/// Number of channels in a stream. | ||
pub type ChannelCount = u16; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.