mbillingr/ambisonic

Make the `play_at` API accept other sample types than f32.

Closed this issue · 3 comments

Currently the play_at function expects sources with sample type f32 because that is what's internally used.

Converting sources from other types requires annoying boilerplate #5.

It should be possible to make the function generic to accept any type that can be safely cast to f32.

Would play_omni benefit from this as well?

Yes, absolutely.

Turns out Rodio sources expose a .convert_samples() method which seems to be convenient enough to use.

I'll rather avoid reimplementing the conversion because Rodio is more likely to get it right.