Reference sound files

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
michelle300
Posts: 5
Joined: Fri Mar 18, 2011 1:36 am

Reference sound files

Post by michelle300 » Sat Mar 19, 2011 3:53 pm

Has anyone tried to refer to a sound file using a variable in IOS? For example:

put the short name of the current card&".wav" into soundtoplay
play specialFolderPath("engine") & "/Audio/soundtoplay"

Doesn't work for me. I would appreciate any help or suggestions. Thanks!

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Reference sound files

Post by Klaus » Sat Mar 19, 2011 4:08 pm

Hi michelle,

variable names must not be in uotes!
And you need to put parenthesis around the filename.

This will work:
...
put the short name of the current card & ".wav" into soundtoplay
play (specialFolderPath("engine") & "/Audio/" & soundtoplay)
...


Best from gemany

Klaus

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Contact:

Re: Reference sound files

Post by ctflatt » Sat Mar 19, 2011 4:09 pm

Klaus:

I was just going to respond to this when your response popped in...

Hilarious!

:T

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Reference sound files

Post by Klaus » Sat Mar 19, 2011 4:25 pm

Well, no wonder, I'm a couple hours ahead of you :D

michelle300
Posts: 5
Joined: Fri Mar 18, 2011 1:36 am

Re: Reference sound files

Post by michelle300 » Sat Mar 19, 2011 4:42 pm

Thanks Klaus and ctflatt. I had tried a version that didn't use the quotes - because I thought the same thing but was getting errors from LC. I probably just had a typo I didn't notice. It is working perfectly! I really appreciate your help! :D :D

michelle300
Posts: 5
Joined: Fri Mar 18, 2011 1:36 am

Re: Reference sound files

Post by michelle300 » Sat Mar 19, 2011 4:44 pm

I posted too quickly - I just noticed this part of the comment "put parenthesis around the filename" -- That was it. Thanks again!

Post Reply