fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.55k stars 928 forks source link

[Question]: Is it possible to identify the deviceType that is being used to play audio in? #2168

Closed arnab closed 11 months ago

arnab commented 11 months ago

What is your question?

_I had asked this on StackOverflow here and one comment mentioned that this is possible with device_info_plus. I am already using this, but don't see how to identify the audio channel/device being used. Hence, asking here:_


I am using just_audio with audio_service and just_audio_background to play audio in my app (in-app as well as background audio).

Is it possible for me to identify the type of device that is being used to play the audio? Such as, is the audio being played via the device (iOS/Android phone/tablet) itself, or perhaps via Bluetooth, CarPlay, AndroidAuto etc.


I could not find anything relevant in SO, in just_audio docs, or in device_info and issues. And ChatGPT is hallucinating (it's telling me some methods that don't exist, but if they did - would have been exactly what I wanted) :)

Checklist before submitting a question

vbuberen commented 11 months ago

No, device_info_plus won't help you with this. I will reply to that SO question as well with some suggested packages to achieve what you want.