Closed yama-yeah closed 1 year ago
I'm aware of this issue but there is no trivial solution.
Changing the return stream to a Stream<Uint16List>
compromises performance when using 8 bit PCM.
Instead, I chose to return the stream from the native backend as-is, meaning for 16 bit PCM every Uint16 is split into two consecutive Uint8 that need to be reassembled by the user.
When Dart as a language has matured enough, I hope to get rid of this annoyance. But right now, not doing any preprocessing on my side is the cleanest choice.
Thank you for your prompt reply. I understood it was due to Dart's specifications. Thanks for the great package!
If the bit depth is set to 16, the uint8, which can only represent up to 2^8, seems inadequate because it must represent values up to 2^16. In short, I think we need to change the return value of MicStream.microphone to Future<Stream\?>.