Page 1 of 1
Playing .wav File
Posted: Fri Dec 04, 2015 2:18 am
by Googie85
I am having trouble playing a sound on my Android tablet. I have tried the following:
MobileControlCreate "player", "testplayer"
MobileControlSet "testplayer", "filename", "wavfile"
MobileControlGo "testplayer", "play"
I have imported as control to wavfile.
I have also tried:
Play wavfile - this works on my PC...
Any help will be appreciated!
Many Thanks,
Matt.
Re: Playing .wav File
Posted: Fri Dec 04, 2015 2:35 am
by Simon
Hi Matt,
I've used .mp3 files for sound, .wav actually has many types of CODECs so I don't like them.
Don't forget you have to use the Copy Files tab to include you sound files and they will be located e.g
Code: Select all
put specialFolderPath("engine") & slash & "goal.mp3" into gSoundGoal
Once on the device.
Simon
Re: Playing .wav File
Posted: Fri Dec 04, 2015 9:46 am
by jacque
The actual command is mobileControlDo. I don't know if that was a typo or not.
I also found recently that, at least on Android, player names don't work. I had to switch to using IDs. Names work okay with native fields but for some reason they fail with players. I've been meaning to report that.
Re: Playing .wav File
Posted: Fri Dec 04, 2015 1:54 pm
by Klaus
Hi Matt,
Googie85 wrote:I...I have imported as control to wavfile...
imported sounds do not work on mobile!
Add your WAV file(s) to your standalone via the standalone builder "Copy files" and access
them as Simon shows in his example script but in -> specialfolderpath("resources")
Best
Klaus
Re: Playing .wav File
Posted: Thu Mar 24, 2016 12:25 pm
by maulinarmananda
I also have an issue with this. Im trying to built my android app. and it contains videos. I can play it in my pc but when I built it in apk, my video doesn't come.
I have tried using code in website but still nothing works. Can someone help me? I really depressed because this is for my final assignment

Re: Playing .wav File
Posted: Thu Mar 24, 2016 2:40 pm
by Klaus
Hi maulinarmananda,
1. welcome to the forum!
2.
maulinarmananda wrote:I also have an issue with this. Im trying to built my android app. and it contains videos. I can play it in my pc but when I built it in apk, my video doesn't come.
I have tried using code in website but still nothing works.
sounds like a pathname problem! What pathname are you using?
Reminder: Imported sound and video files do NOT work on mobile.
And please post your script(s), I am sure we can work that out!
Best
Klaus
Re: Playing .wav File
Posted: Thu Mar 24, 2016 4:06 pm
by maulinarmananda
this is my code
on openCard
if the environment = "mobile" then
put specialFolderPath("engine") & "/qtimun.mp4" into tVidFile
mobileControlCreate "player", "myPlayer"
put the result into sPlayerID -- save the control id
mobileControlSet sPlayerID, "filename", tVidFile
mobileControlSet sPlayerID, "visible", true
mobileControlSet sPlayerID, "rect", "30,32,414,330"
mobileControlSet sPlayerID, "showController", false
mobileControlSet sPlayerID, "preserveAspect", false
--mobileControlDo "myPlayer", "play"
--mobileControlDo "myPlayer", "pause"
end if
end openCard
mobileControlSet sPlayerID, "visible", false
on closeCard
end closeCard
sorry Klaus for asking you in other question. I will just gonna use this one. Hope I can fix my problem