android - How to stream mic data between flutter and platform? -
i been trying figure out how stream mic data android flutter. found example code on how query mic in chucks not know way data onto flutter.
i not sure classes in flutter
https://docs.flutter.io/flutter/services/eventchannel/receivebroadcaststream.html
i wonder if can me point right direction.
i been digging through example plugins in flutter github , found this.
https://github.com/flutter/plugins/tree/master/packages/sensors
unfortunately me, eventchannel documentation sparse. not believe can pass streams flutter platform can replay whatever recorded in feedback loop.
event callback. supports dual use: producers of events sent flutter act clients of interface sending events. consumers of events sent flutter implement interface handling received events (the latter facility has not been implemented yet).
https://docs.flutter.io/javadoc/io/flutter/plugin/common/eventchannel.eventsink.html
the process similar creating methodchannel, need create oncancel , onlisten in android. within onlisten, must create listener receive events. if want create audio events, must use setpositionnotificationperiod(int) , onrecordpositionupdatelistener(listener).
https://developer.android.com/reference/android/media/audiorecord.html
on flutter must create broadcast stream event
https://github.com/flutter/plugins/blob/master/packages/sensors/lib/sensors.dart
i manage write own terrible plugin android atm. if needs wonder permissive license should add
Comments
Post a Comment