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

replace soxr for tempo stretching with something that does not change pitch #24

Open
christf opened this issue Feb 28, 2019 · 1 comment

Comments

@christf
Copy link
Owner

christf commented Feb 28, 2019

Alternatives are:

  • librubberband which can only work with 2048 bytes at a time
  • tempo effect from libsox - from a casual glance it seems it can work with arbitrary input sizes

This will require more analysis.

@christf
Copy link
Owner Author

christf commented Mar 8, 2020

Having looked at this again, there are a few gotchas:

  • librubberband wil work only on float. As such the client will have to convert to float, then apply librubberband and then feed alsa. There are two ways of doing this: always convert to float and open the alsa device in an appropriate way or only convert (back) when stretching is required. The latter seems to be the better choice. However librubberband wants to be fed samples of 2048 bytes at a time. This will not alighn with the chunk size of snapcastc. Worst case 2047 bytes per chunk are left unstretched.

  • libsox is available to do tempo stretching however it only works on files, not on byte arrays in memory. There are a few threads from 2013 where Ulrich states that streaming support should be added to sox but I was unable to find it in the docs yet.

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