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

[Feature request] Add support for fractional sample rate in AssumeSampleRate #428

Open
numlockkey opened this issue Feb 13, 2025 · 2 comments

Comments

@numlockkey
Copy link

Would it be possible to implement this functionality?

I would like to be able to do something like this:

AssumeSampleRate(44101.435432)
ResampleAudio(44100)

@numlockkey numlockkey changed the title Add support for fractional sample rate in AssumeSampleRate [Feature request] Add support for fractional sample rate in AssumeSampleRate Feb 13, 2025
@pinterf
Copy link

pinterf commented Feb 14, 2025

Unfortunately the underlying property is strictly integer and cannot be changed. (audio_samples_per_second is part of the untouchable VideoInfo struct)

@pinterf
Copy link

pinterf commented Feb 14, 2025

But you can play with ResampleAudio parameters (nominator, denominator syntax) and make AssumeSampleRate(44100) at the end.

AssumeSampleRate(44100);
ResampleAudio(44100, 44101);  // Actually downsample from 44101.435432 to 44100
AssumeSampleRate(44100);

(Original value: 44101.435432/44100 ~ 1.000032551 Approximation: 44101/44100 ≈ 1.000032653)

Or something like this.

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

2 participants