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

Sample rate conversion doesn't perform well #14

Open
thijzert opened this issue Mar 14, 2021 · 1 comment
Open

Sample rate conversion doesn't perform well #14

thijzert opened this issue Mar 14, 2021 · 1 comment

Comments

@thijzert
Copy link
Owner

When running speeldoos on a Raspberry Pi 1, having a mix of 48kHz and 44.1kHz audio in your library isn't the greatest experience. When it tries to play something it has to convert from one to the other, you get a small chunk of audio every 10 seconds or so. Playing a 20-minute file takes over 4 hours.

The hardware in the Pi 1 is rather constrained: it's a 32-bit single-core board. Having it do 672,000 sine calculations per second probably isn't its idea of "fun".

There's bound to be some clever way of doing all the floating-point operations ahead of time, and reducing that to a multiplication table on int64's, using fixed-point math. On a Pi 1 it's still not going to be quick, but if this makes it faster than realtime it'll make all the difference.

@thijzert
Copy link
Owner Author

I added a benchmark to measure just how bad it is: converting 100 seconds of audio takes 28 minutes, so we're reading audio at 0.06× speed.

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

1 participant