Fix example

This commit is contained in:
Roderick van Domburg 2021-03-12 23:18:18 +01:00
parent 5257be7824
commit 6379926eb4

View file

@ -5,7 +5,7 @@ use librespot::core::authentication::Credentials;
use librespot::core::config::SessionConfig; use librespot::core::config::SessionConfig;
use librespot::core::session::Session; use librespot::core::session::Session;
use librespot::core::spotify_id::SpotifyId; use librespot::core::spotify_id::SpotifyId;
use librespot::playback::config::PlayerConfig; use librespot::playback::config::{AudioFormat, PlayerConfig};
use librespot::playback::audio_backend; use librespot::playback::audio_backend;
use librespot::playback::player::Player; use librespot::playback::player::Player;
@ -16,6 +16,7 @@ fn main() {
let session_config = SessionConfig::default(); let session_config = SessionConfig::default();
let player_config = PlayerConfig::default(); let player_config = PlayerConfig::default();
let audio_format = AudioFormat::default();
let args: Vec<_> = env::args().collect(); let args: Vec<_> = env::args().collect();
if args.len() != 4 { if args.len() != 4 {
@ -35,7 +36,7 @@ fn main() {
.unwrap(); .unwrap();
let (mut player, _) = Player::new(player_config, session.clone(), None, move || { let (mut player, _) = Player::new(player_config, session.clone(), None, move || {
(backend)(None) (backend)(None, audio_format)
}); });
player.load(track, true, 0); player.load(track, true, 0);