Newbie wants to play a specific music file

997 views
Skip to first unread message

Ohrange

unread,
May 23, 2015, 1:04:36 AM5/23/15
to automa...@googlegroups.com
Hi, I'm completely new to Automate so I thought I'd start with something simple.

I want an audio file on my phone to play at a certain time. I've found the time window and play sound blocks. I see I need a URI to specify audio that is not loaded as a ringtone. The file is in my download folder so I've tried "content://mnt/sdcard/download/file.mp3" but I'm getting the error "java.io.IOException: setDataSource failed.: status=0x90000000". I'm using Ice Cream Sandwich.

Any pointers greatly appreciated - I'm really just stabbing in the dark at the moment. Would also love suggestions on the best place to start learning how to use Automate. I've found this forum, the documentation and I've been looking at example flows from the community. Am I missing anything?

Automate developer

unread,
May 23, 2015, 1:57:44 PM5/23/15
to automa...@googlegroups.com, toni.a...@gmail.com, toni.a...@gmail.com
Try writing "file://{"downloads";storage}/file.mp3" in the URI field.

Currently the "Content URI" fields, used in various blocks, doesn't work as the "Path" fields does, i'll fix that.

jholi...@gmail.com

unread,
Jul 20, 2017, 2:46:42 PM7/20/17
to Automate
I have a file (two places) in main storage and on the SD card located under the same named "Sounds" folder.

I tried this "file://{"Sounds";storage}/file.mp3" in the sound URI field to no avail.  I get the error ... Illegal.Argument.Exception: Illegal Storage: Sounds

Further when I click to choose (not enter via typing) it spins and never returns (or I have given up after 10+ minutes). Yes my SD card contains a bunch of music but would have expected to return eventually.
I would like to know how to differentiate between main and SD card - in such a URI.

This post is 2y old (searched nothing sooner). Is there any way to get to the main storage or SD card using standard naming conventions as shown say via ES File Explorer?

(Android is 7.0 Moto Z Play; Automate - latest from Play)

Thanks!
jeff
 

Henrik "The Developer" Lindqvist

unread,
Jul 20, 2017, 3:50:34 PM7/20/17
to Automate, jholi...@gmail.com
The "storage" function only take specific types, not "Sound" see:
http://llamalab.com/automate/doc/function/storage.html

For primary external (main) storage:
file://{"primary";storage;file.mp3}

A removable SD card has a unique path, as granted on the "External storage access" screen in Automate settings. Use the File pick block.

jonas...@gmail.com

unread,
Apr 21, 2018, 2:33:14 PM4/21/18
to Automate
Just in case someone else has the same problem that I did:
Go to Settings -> Privileges -> access photos, media and files on your device.
The exception that I got was java.lang.SecurityException, and changing the above setting solved the problem. Then content://... worked fine.
Reply all
Reply to author
Forward
0 new messages