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.

https://github.com/bitplane/microphone/blob/master/src/net/bitplane/android/microphone/microphoneservice.java

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

https://github.com/flutter/plugins/blob/master/packages/sensors/android/src/main/java/io/flutter/plugins/sensors/sensorsplugin.java

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

https://github.com/hungrymonkey/mic_stream


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -