Playing Sounds in iOS
cmsheffield at me.com
Wed Jun 20 10:38:58 EDT 2012
When using mobilePlaySoundOnChannel, I've always had to build the full path to the file for it to work correctly. So if you've verified that it's copying correctly into the app bundle and, assuming it's not in a sub folder of the bundle, try something like this:
if the environment is "mobile" then
put specialFolderPath("engine") & "/mySnd.wav" into tPath
mobilePlaySoundOnChannel tPath, "current", "now"
Hopefully that'll work for you. If you have the sound file in a sub folder in the bundle, simply make sure to include that in the path.
On Jun 20, 2012, at 7:46 AM, Roger Guay <irog at mac.com> wrote:
> Hi all,
> I'm trying to play a sound in iOS.
> My code: if the environment is "mobile" then mobilePlaySoundOnChannel "mySnd.wav", "current", "now"
> else play "mySnd.wav"
> I've imported mySnd.wav to the stack and I've copied it to the "Non-stack files in the application" of the Standalone Application Settings.
> it works in the IDE but not in the simulator nor my iPad.
> Any help please?
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode