Can I trigger AudioRecordingIntent from a bluetooth device

I have a BLE device which my app connects to and can detect button presses. On a button press, I want my app to start recording using the AudioRecordingIntent. But my app doesn't work and throws a background error. Is there any reliable way I can get the app to start recording audio in the background?

I also wanted to check if my app can trigger audio recording from the background if my bluetooth device supports and is active on HFP mode

I have a BLE device which my app connects to and can detect button presses. On a button press, I want my app to start recording using the AudioRecordingIntent. But my app doesn't work and throws a background error. Is there any reliable way I can get the app to start recording audio in the background?

No, at least not within the "general" audio API. There's a privacy block in place that prevents recording sessions from activating in the background. Our voice communication APIs (CallKit, LiveCommunicationKit, and the PushToTalk framework) do allow this, but that's done as part of the system’s larger call management architecture and is not something that's possible outside of those APIs. If you’re working on some kind of communication app, then you can certainly use one of those framework, but they can’t be used for any other purpose.

I also wanted to check if my app can trigger audio recording from the background if my Bluetooth device supports and is active on HFP mode.

No, this doesn't really change anything, as your accessory doesn't have any visibility/control over the system’s "state". Technically, your accessory could initiate a call through HFP, but that would route to the phone app, not "your" app. Similarly, the APIs above actually all implement support for handling HFP events... but if you're using those APIs, you don't need your accessory to start recording.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Can I trigger AudioRecordingIntent from a bluetooth device
 
 
Q