Sounds in iOS

Graham Samuel livfoss at mac.com
Tue Feb 21 12:25:23 EST 2012


Thanks to Mark and Ken for interesting insights. I am beginning to think that embedded sounds within stacks don't work in iOS, even if one does respect case sensitivity. I am going to do some more tests, but basically I found that Ken's method (using an external file) works for me, but despite being very careful about case sensitivity, I can't get the embedded sounds to work. This is a bummer, because in my experience, the first time you play a sound from a file you get a delay, and all my sounds are supposed to coincide with short events that the user sees on the screen (think some kind of crash). I suppose there may be a method of pre-loading sounds - I may have to search for one.

Has anyone got embedded sounds (the audioclips attached to stacks, that have always worked in the desktop versions of LC) to work on iOS?

TIA

Graham

On Mon, 20 Feb 2012 23:12:51 +0100, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:

> Graham,
> 
> The full path is not the full path to some sound object in a stack but the full path to the file on disk. For example specialfolderpath("engine") & slash & "sounds" & slash & "Xylo.aif"
> 
> I think that file paths on the iPhone are case sensitive. I'm not entirely sure whether this also applies to LiveCode scripts but I always take case sensitivity into account.
> 
> --
> Best regards,
> 
> Mark Schonewille

On Tue, 21 Feb 2012 08:08:33 +0000,  Ken Corey <ken at kencorey.com> wrote:

> Hi Graham,
> 
> I found it a bit difficult as well.  Keep in mind I've only just started 
> with LiveCode, so there's bound to be some wrong information here.
> 
> Take a look at this stack:
> http://its.ec/static/iossounddemo.zip (158k)
> 
> The keys that I needed were:
> 1) Put sounds into a sub folder of my project
> 2) Ensure that in the Copy Files tab, the subdirectory is included.
> 3) Make the files .caf files (make .aiff files, and rename them to .caf)
> 4) Use the rootPath function given so the files work in both the IDE and 
> iOS device.
> 
> Hope this helps.
> 
> -Ken
> 
Previously, I wrote:

>> I haven't had much luck on my iOS iPad app with waiting until a sound is done (RR have just said I found a bug), but ignoring this issue I can't get a really simple 'play' statement to work. I have a button
>> 
>> play "Xylo.AIF"
> 
and 
> 
>> I haven't had much luck on my iOS iPad app with waiting until a sound is done (RR have just said I found a bug), but ignoring this issue I can't get a really simple 'play' statement to work. I have a button
>> 
>> play "Xylo.AIF"
>> 
>> which works in the IDE but not in the simulator. In case it was a path problem, I added a line that sets the defaultStack to the stack where the sounds are stored (this is not the stack where the button is); this makes no difference in the IDE but it still doesn't work in the simulator. I then used the full name of the file which is actually
>> 
>> audioclip "Xylo.AIF"
>> 
>> with the same result. Changing the playLoudness didn't do anything either.
>> 
>> I read somewhere (but can't find it) that for iOS one needs a full path to the sound, but I don't know what the full path of an embedded sound would look like.
>> 
>> Has anyone got iOS sounds to work in 5.0.2?
>> 




More information about the use-livecode mailing list