Playing Sounds in iOS

Devin Asay devin_asay at byu.edu
Thu Jun 21 14:16:54 EDT 2012


Roger,

Maybe you've done this, but keep in mind that the iOS file system is case sensitive, unlike the OS X file system. Could there be case mismatches in your file paths and/or names?

Devin


On Jun 21, 2012, at 11:43 AM, Roger Guay wrote:

> Thanks so much for you patience, Chris . . . I'm learning a lot from you, but unfortunately, I'm still not able to play sounds in iOS. In answer to your questions and points:
> 
> I am not able to play sounds in either the simulator nor my iPad.
> 
> The answer command you suggest (very clever!) returns false in the simulator and on my iPad. Yet, I have verified the files are sitting in plain site of Show Package Contents folder of the standalone
> 
> You mention that "You can also verify the path by looking at the path as it's listed in Standalone Application Settings". Where is that? I can't seem to find anything except the "Default build folder", which in my case is my desktop. Doesn't the "engine folder" take care of path automatically when running on the device?
> 
> Thanks again,
> 
> Roger
> 
> 
> On Jun 20, 2012, at 3:12 PM, use-livecode-request at lists.runrev.com wrote:
> 
>> Message: 10
>> Date: Wed, 20 Jun 2012 13:14:11 -0600
>> From: Chris Sheffield <cmsheffield at me.com>
>> To: How to use LiveCode <use-livecode at lists.runrev.com>
>> Subject: Re: Playing Sounds in iOS
>> Message-ID: <D9E8907F-8AFF-48C5-BD78-B900BC68BE8A at me.com>
>> Content-Type: text/plain; CHARSET=US-ASCII
>> 
>> Your code seems okay as far as I can tell. I'm guessing the path is not getting set correctly. Are you running this in the simulator or on a device?
>> 
>> One really quick way to verify the path of a file, especially if you're running in the simulator, is to simply place an answer command right before the call to mobilePlaySoundOnChannel to check the existence of the file you're trying to play. So something like:
>> 
>> answer there is a file tSoundFile
>> 
>> This will return true if the file exists, false otherwise. If your app is built for a device and you want to make sure the file are copying into the bundle correctly, in the Finder, right click on the bundle and choose Show Package Contents. Your files will either be right inside that folder or inside a sub folder. So just make sure to set the path accordingly. You can also verify the path by looking at the path as it's listed in Standalone Application Settings. If there are any folder names as part of the path, those folders will be created inside your app bundle and need to be included when building paths for the sound files.
>> 
>> So if you've verified the path and things are still not working, the only other thing I can think of is that you've got files that are not compatible with iOS for whatever reason, though I believe those file types are.
>> 
>> Chris
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University







More information about the use-livecode mailing list