sound works on pc but not on android.

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
TubooBokBok
Posts: 19
Joined: Wed Jun 18, 2014 7:23 pm

sound works on pc but not on android.

Post by TubooBokBok » Sun Jul 06, 2014 6:39 pm

Hi. I have buttons that play a sound when clicked using the code play "pop.wav". I have imported the sound as a control and have copied the sound into the standalone application settings.

The sound plays on my pc but when I test the app on my android phone sounds wont play. Do I need to run the sound through special file paths?

Help is greatly appreciated.

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: sound works on pc but not on android.

Post by sefrojones » Sun Jul 06, 2014 6:44 pm

Check out the specialfolderpath function in the dictionary. Specifically the note about android:
Android Note: An Android application is installed on the phone in the form of its zip package. This means that any assets that are included are not available as discrete files in the native filesystem. In order to manage this the engine essentially 'virtualizes' the asset files you include, allowing (read-only) manipulation with all the standard LiveCode file and folder handling syntax. To access the assets you have included within your application, use filenames relative to specialFolderPath ("engine").


Here is a link to a tutorial that is a bit more in depth than the dictionary entry:

http://livecode.byu.edu/audio/audioplayback-mobile.php


--Sefro

TubooBokBok
Posts: 19
Joined: Wed Jun 18, 2014 7:23 pm

Re: sound works on pc but not on android.

Post by TubooBokBok » Sun Jul 06, 2014 7:40 pm

Thank you very much. I have it working now :D

Post Reply