Skip to content

Playing source in sink automatically goes to the end #4

Description

@NightlySide

Hello, I want to say thank you first for this great crate.

I followed the examples and manage to play an AAC file without any problem. However when trying to play an .m4a (using the MPEG-4 AAC codec) from youtube-dl (example : https://bit.ly/3JKrlRL) playing the sink automatically goes to the end without playing the song.. What did I do wrong ?

Thank you in advance

PS: here is the following code i'm using

let file = File::open("path to the .m4a").expect("error opening file");
let buf = BufReader::new(file);

let decoder = redlux::Decoder::new_aac(buf);

let output_stream = OutputStream::try_default();
let (_stream, handle) = output_stream.expect("Error creating output stream");
let sink = Sink::try_new(&handle).expect("Error creating sink");

sink.append(decoder);
println!("Playing");
sink.play();
sink.set_volume(1.0);
sink.sleep_until_end();
println!("End of track");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions