PushMicrophoneSession
A MicrophoneSession whose audio is pushed in by a platform transport — BLE notifications, a Flutter event channel, an OS microphone callback, etc.
This centralizes Kotlin Flow production so platform adapters that cannot easily build a MutableSharedFlow themselves (notably Swift / Kotlin-Native adapters bridging a vendor SDK) only need to call plain methods: emit for each audio frame, emitEndOfStream when the vendor signals end-of-stream, and the inherited stop when the app tears the session down.
Threading: audio is a hot MutableSharedFlow whose tryEmit is thread-safe, so the transport may call emit from whatever callback thread it uses. The transport is expected to supply a monotonically increasing emit sequence (vendors like Frame already number their frames).
Parameters
invoked once when the session stops, so the adapter can tell the vendor/transport to stop streaming (e.g. a "stopMicrophone" channel call). Kept non-suspending so it is trivial to pass from Swift.
Functions
Terminate the stream with an end-of-stream marker (empty bytes). Idempotent — subsequent calls (and any late emit) are ignored.