Feature description
It would be nice if there was a flag for microphone-related commands which would cause the microphone on a Bluetooth headset to be used, rather than the phone microphone. Perhaps a -m flag for:
termux-microphone-record
termux-dialog speech
termux-speech-to-text (which isn't working on my device, but I thought I'd mention it)
Reference implementation
Have you checked if the feature is accessible through the Android API?
The answer to this question seems to indicate there's a closed source video app that does it, though I haven't tried that app.
Do you know of other open-source apps that has a similar feature as the one you want? (Provide links)
I can't find any that are open source