You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can see (although I may have missed something); there's no way to create a non-interleaved non-blocking stream with safe code (i.e. not transmute()ing the callback arg to &mut [&mut [f32]]). Am I correct here, and what could be done to resolve this problem?
I will add that providing data in interleaved form, in my use case, requires significant extra processing in the audio thread to do (loop through non-interleaved buffers, which must be preallocated & write to interleaved buffer).
The text was updated successfully, but these errors were encountered:
You're right, support for writing to non-interleaved buffers hasn't yet been added, though it would be a welcome addition!
Currently StreamParameters takes an is_interleavedbool at runtime (which is unhandled at the callback end as you've discovered). It would be nicer to have this moved to the type level so that the user receives errors about mis-use at compile time instead of runtime. I've been meaning to add something along the lines of a Buffer trait but haven't had time.
Something like this might allow the compiler to infer whether or not the buffer is interleaved by examining the buffer type used in the callback args at compile time. This way we might be able to get away with removing the need for a is_interleavedbool param altogether.
As far as I can see (although I may have missed something); there's no way to create a non-interleaved non-blocking stream with safe code (i.e. not
transmute()
ing the callback arg to&mut [&mut [f32]]
). Am I correct here, and what could be done to resolve this problem?I will add that providing data in interleaved form, in my use case, requires significant extra processing in the audio thread to do (loop through non-interleaved buffers, which must be preallocated & write to interleaved buffer).
The text was updated successfully, but these errors were encountered: