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

symphonia impl total_duration #405

Open
kamiyaa opened this issue Dec 5, 2021 · 3 comments
Open

symphonia impl total_duration #405

kamiyaa opened this issue Dec 5, 2021 · 3 comments

Comments

@kamiyaa
Copy link

kamiyaa commented Dec 5, 2021

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!

@Alch-Emi
Copy link

Alch-Emi commented Jan 3, 2022

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)

@est31
Copy link
Member

est31 commented Jan 25, 2022

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.

@dvdsk
Copy link
Collaborator

dvdsk commented Oct 11, 2023

I needed this as part of #513. I implemented it following the suggested approach in the symphonia documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants