Playing Sounds in iOS

Chris Sheffield cmsheffield at me.com
Wed Jun 20 09:38:58 CDT 2012


Roger,

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"
else
play "mySnd.wav"
end if

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.

Chris Sheffield


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?
> 
> Thanks!
> Roger 
> 
> 
> 
> _______________________________________________
> 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



More information about the use-livecode mailing list