我正在试着用rodio播放一些声音。
我正在创建Source并将其放入Sink中,但我如何知道其中之一何时停止播放?例如,我想转到第一首歌之后的下一首歌。
let device = rodio::default_output_device().unwrap();
let sink = Sink::new(&device);
let file = File::open(path).unwrap();
let source = rodio::Decoder::new(BufReader::new(file)).unwrap();
sink.append(source);我在rodio文档中没有找到任何关于回调或类似的东西。有一个Done struct,但我不清楚如何使用它,甚至不知道它是否是我正在寻找的东西。
发布于 2021-10-07 04:28:06
我想你要找的是returns true if there are no more samples within the sink to play的Sink::done。
https://stackoverflow.com/questions/60836556
复制相似问题