-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmusicVoiceSearch.sh
More file actions
executable file
·30 lines (24 loc) · 904 Bytes
/
musicVoiceSearch.sh
File metadata and controls
executable file
·30 lines (24 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Created by Sujay Davalgi
#
# Send the Assistant voice play input to PlayMusic
#
# Usage: ./musicVoiceSearch.sh [<Device Serial>]
# Command line Arguments (Optional):
# $1 - Input the device serial
# If the serial number is not provided, it will display the list of attached devices to pick from
. ./library/mainFunctions.sh
. ./library/textFormatting.sh
. ./library/deviceOperations.sh
voiceSearchString="test"
if [ $# -lt 1 ]; then
echo -e -n "\n Enter the search string : "
read voiceSearchString
else
voiceSearchString="$1"
fi
getDeviceChoice
displaySelectedDevice $deviceSerial
if [[ "$( isAdbDevice $deviceSerial )" == "true" || "$( isRecoveryDevice $deviceSerial )" == "true" ]]; then
adb -s $deviceSerial wait-for-device shell am start -a android.media.action.MEDIA_PLAY_FROM_SEARCH -n com.google.android.music/.VoiceActionsActivity --es "query" "${voiceSearchString}"
fi