Play a mp3 in the background

Solved
M
Majid
bolcom

Is there a way to play an audio file (mp3) on an Android+ device (also setting the volume)?

I found the 'sendintent' script command for playing a video file, could this also be used for audio?

7 years ago
Android
ANSWERS
M
Majid
7 years ago

Received the following answer from SOTI support, which worked for me (solved):

sendintent -a "intent:file:///sdcard/download/findme.mp3#Intent;type=audio;component=com.android.music;end"

Solution
R,
Ross , Hathaway
7 years ago

Hi 

Please see below that should play the particular file from the SD card just change name of file where NameOfFile is

Intent:file://%sdcard%NameOfFile#Intent;type=audio/mpeg;action=android.intent.action.VIEW;end

Thanks

M
Majid
7 years ago

Hi Ross,

Thanks for the response. Just tried it, but it's not supported:

Script command is not supported by device (intent:file:///storage/emulated/0/download/file.mp3#intent)

Device type: Zebra TC8000

OS: Android 5.1.1

M
Majid
7 years ago (edited 7 years ago)

Slightly modified the script to:

sendintent -a ":file://%sdcard%download/file.mp3#Intent;type=audio/mpeg;action=android.intent.action.VIEW;end"

Now it's accepted, but doesn't play the file.

Log:

Send action request (Send Script [ sendintent -a ":file://sdcard/download/file.mp3#Intent;type=audio/mpeg;action=android.intent.action.VIEW;end" ])

The mp3-file on itself works fine when selected locally on the device.