Open leidig54 opened 3 years ago
The Android implementation looks like it internally creates a list of integer objects for the generated wave data to send over the method channel to the plugin's Flutter front-end. This is very memory-inefficent, particularly at low frequencies and a high sample rate which results in a long list of individual heap-allocated Integer
objects. And these get recreated each time the frequency changes which is not good if the user can adjust the frequency with a Slider and cause this to get recreated many times per second.
Instead, it would be better to use a normal Java array - see the documentation for StandardMessageCodecStandardMessageCodec . A Java byte array is received on the Flutter side as a Uint8List
. If the audio data is 16 bit, that data needs to be packed into a byte array where adjacent bytes make up a short, as long as the same endian-ness is used on both sides of the platform channel.
Hi @mertguner
I am getting the following error through firebase crashlytics on some devices.
No issues on my own test device.
Any suggestions?