|
Hi, I'm using Is there a simple way to achieve that? Regards, |
Replies: 3 comments
|
|
If you have a slice of samples, I would not recommend this, as directly transmuting between slices is UB if I recall, plus the size will most likely be wrong. Do something like this instead: If you only want to convert one sample then I would probably create a trait akin to this: While this is something that could be implemented in cpal, I really see no reason for it. |
|
Yes, this is completely out of scope for cpal, Use something like the above, or the |
If you have a slice of samples, I would not recommend this, as directly transmuting between slices is UB if I recall, plus the size will most likely be wrong. Do something like this instead:
If you only want to convert one sample then I would probably create a trait akin to this: