Open kamiyaa opened 2 years ago
Bit of a novice here, but it looks like the sampling rate and total number of frames are both available in CodecParameters
for the track, but I have no idea how many samples / packet there are, or how to find that information. If anyone else knows how to get that, though, an implementation should be pretty trivial (samples_per_frame * n_frames / sample_rate = length in seconds)
Not all formats have streams where each frame has the same number of samples. E.g. in vorbis the number can vary from frame to frame.
I needed this as part of #513. I implemented it following the suggested approach in the symphonia documentation
https://github.com/RustAudio/rodio/blob/master/src/decoder/symphonia.rs#L136
Just wanted to create an issue tracking this. Am also curious if there is any active work on this? Thank you!