Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rodio version to 0.14. #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ffmpeg-sys-next = { version = "4.3.4", default-features=false, features=['avcode
thiserror = "1.0"
log = "0.4"

rodio = { version = "0.11", default-features=false, optional=true }
rodio = { version = "0.14.0", default-features = false, optional = true }

[workspace]
members = [
Expand Down
4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2018"
[dependencies]
ffmpeg-decoder = { path = "../", features = ['rodio_source'] }

rodio = { version = "0.11", default-features=false }
rodio = { version = "0.14.0", default-features = false }

anyhow = "1.0"
env_logger = "0.7"
log = "0.4"
structopt = "0.3"
structopt = "0.3"
4 changes: 2 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ fn decode_to_file(input: PathBuf) -> Result<(), Error> {
fn play_file(input: PathBuf) -> Result<(), Error> {
let decoder = ffmpeg_decoder::Decoder::open(&input)?;

let device = rodio::default_output_device().unwrap();
let sink = Sink::new(&device);
let (_stream, stream_handler) = rodio::OutputStream::try_default()?;
let sink = Sink::try_new(&stream_handler)?;

sink.append(decoder);
sink.play();
Expand Down
13 changes: 7 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
//! ## Example as Rodio Source
//!
//! ```rust
//! use rodio::Sink;
//! use std::path::PathBuf;
//! use rodio::{OutputStream, Sink};
//! use std::path::Path;
//! use std::error::Error;
//!
//! fn play_file(input: PathBuf) -> Result<(), Error> {
//! let decoder = ffmpeg_decoder::Decoder::open(&input)?;
//! fn play_file(input: impl AsRef<Path>) -> Result<(), Box<dyn Error>> {
//! let decoder = ffmpeg_decoder::Decoder::open(input)?;
//!
//! let device = rodio::default_output_device().unwrap();
//! let sink = Sink::new(&device);
//! let (_stream, stream_handler) = OutputStream::try_default()?;
//! let sink = Sink::try_new(&stream_handler)?;
//!
//! sink.append(decoder);
//! sink.play();
Expand Down