Skip to content

Media control#840

Merged
davecraig merged 18 commits intomainfrom
media-control
Mar 2, 2026
Merged

Media control#840
davecraig merged 18 commits intomainfrom
media-control

Conversation

@davecraig
Copy link
Contributor

The Play Store gave us the go ahead to use audio record in the way that we do, so it's safe to land the changes on main.

davecraig and others added 18 commits March 2, 2026 15:54
Pressing the Play/Pause button starts the speech recognition listening.
Pressing the Play/Pause button starts the speech recognition listening.
A limited set of commands which are all in strings.xml. We get "the whole
string" passed in from the speech recognition API so we can match route and
marker names too. This could control pretty much everything.
We should come up with a design - and it probably goes hand in hand with a
menu navigation UI for users whose language is not supported by Android
speech recognition.
Although these changes should in theory work in other languages, I don't I've
figured out how to configure my phone to work and so I get a lot of "Error"
callbacks right now.
We've got a number of different ways that media controls can be used, so tidy
that away into their own classes.
This relates to https://sta2020.atlassian.net/browse/SA-285 and implements the start of an Audio
Menu controlled via media control buttons. This allows app control without using the phone UI.
Media control buttons can be working in:

 Original mode - similar to on iOS. Relatively hard coded.
 Voice control - the play/pause button triggers voice control.
 Audio menu - a whole audio menu is navigable via the controls.
The callout holdoff initially was for the audio menu, but is useful for
voice control too.
…rface

Voice commands and the audio menu can now be used to start audio beacons at
markers, and route playback.
Nothing very clever here, just a bit of refactoring.
All possible voice commands along with marker and route names are passed into the
SpeechRecognizer so that it knows what to expect.
Fallback to audio menu if no permission granted.
This new approach should work better across different languages. We compare
complete commands including marker and route names rather than trying to
split them up into command + name. This should handle languages where the
ordering of the command and names isn't simple.
Some extra work goes on here so that we try and pick the best language and
region.
Also fix dokka build which was broken due to an incompatibility between
AGP and the plugin.
@davecraig davecraig merged commit 9dba1c2 into main Mar 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant