-
Notifications
You must be signed in to change notification settings - Fork 240
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
hifi resampler #670
base: master
Are you sure you want to change the base?
hifi resampler #670
Conversation
|
Matching rubato's interface to the current inhouse solution does not work. Rubato always outputs f32, inhouse matches input. You can not have an Iterator that sometimes outputs a fixed type and sometimes is generic (generic generics don't exist). Solution: do away with DataConverter and make the resampler convert to the target sample type. Now both rubato and inhouse are generic, both output the target sample type
Probably you could also make I am not against generics when they are fairly readable. Like the Making the sample converter more flexible and able to hold objects I also like, because there may be more use cases. For example: dithering, that would needed to be done in that step and where you also want to store a |
Thats sort of what this does, rubato works on all sample types with this PR. To get a single resampler trait you have to do output conversion in the same trait implementation as you do resampling. That is needed since the inhouse fully generic resampler returns the same output type as you pass in. Basically its a limitation of the rust type system. As far as I know you can not have a trait that expands iterator and has both:
Regarding calling to sample on rubato output to make its output generic. Yes you can do that but now you are converting between types more then necessary. The compiler is not allowed to 'optimize' that out since it has effects. Anyway I propose we halt the discussion and work on this till we have figured out if the generics even stay. If they do not and the pipeline becomes completely f32 this PR can be massively simplified. |
This is a mess, it is far from done and going to require significant changes to the core of rodio. I am opening this PR mainly so I have a place to dump notes.