on mouseUp
play specialFolderPath("engine") & "tm_btn_mech_03.wav"
end mouseUp
when i build for ios i get no warnings... but when i try a build for osx to test, i get this warning:
1 Could not auto-detect inclusions or security categories because stack is password protected
you need ot put parenthesis around concatenated pathnames (and other thing, too)!
AND you need to add a SLASH, since "specialfolderpath" does NOT return a trailing slash!
...
## This will do:
play (specialFolderPath("engine") & "/tm_btn_mech_03.wav")
...
play specialFolderPath("engine") & "/Vertigo Sounds/tm_btn_mech_03.wav"
But that was resorting to including the file in standalone setup > copy files.
Cant find the path to a file imported into the stack. That ends up in the AudioClips.
Is there a folder created in the bundle called AudioClips at build time..?
Well, I'm afraid you're out of luck, since currently imported sounds are not supported on iOS!
You will need to copy all (or all used) sounds into the standalone via the "Copy files" tab in the
standalone builder and then access the sound like in the script above.
You can't play audioclips that are embedded in stacks in an iOS app. For iOS, all sound files must be on disk and referenced with a file path. The file path is always relative to the engine, so it will always start with specialFolderPath("engine").
The sounds should be included in the Copy Files pane of the standalone settings. You can throw them in loose there, or copy in a whole folder. If you use a folder, then your iOS app will also use that folder in the path, i.e.: specialFolderPath("engine") & "/mySounds/sound.mp3".
Since mobile apps can't use embedded sounds, you'll save a lot of space if you remove the ones you've already imported.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
In order copy audio files into the standalone maker, do I first need to place them in a special folder called "engine"? to get specialFolderPath("engine") ?
No, you can't export imported sounds. You'll need to use your originals.
The "engine" folder is the one that the standalone builder creates to hold your app. Every file you include will be inside that main enclosing "engine" folder. Don't create one yourself. The easiest way to manage sound files is to put them all into a single folder. Put that folder into the same one that holds your mainstack on disk. In the Copy Files pane of the standalone builder, choose to include a folder and point it to your sounds folder. The copy files pane should then have an entry something like this:
I.e.: all your paths will be relative to the engine folder, in a subfolder named "mysounds" just like it is on your hard drive. You can think of the "engine" folder in an iOs app as being the folder that holds your mainstack on disk.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Thanks again Jacqueline. I guess the ios environment does have it's own peculiarities.
Does anyone know of any tools or clever tricks for extracting audio files from LiveCode? (Possibly re-recording audio being played from a stack? or will ResEdit work?)
I did get this sound to play on my Mac, but would not play on my IOS simulator.
play specialFolderPath("engine") & "/Users/macbookpro/Documents/jokesfolder/book.aif"
Can I get sounds to play on my simulator?
By the way, I really think sound files should be as easy to use as everything else is in LiveCode. I mean, look how easy a picture file is to use,edit, delete, blend, add graphic effects, rotate, etc. Quicktime is the only program that Livecode accepts to import an audio file. I've tried Garageband, SoundBooth, Soundtrack pro, to create .wav and .aif files, but they all just screech in Livecode.
The sounds won't play in the simulator because the simulator uses the same file hierarchy as your standalone will use. For that, you must use the file structure I described, where your sounds are in a folder that is relative to the standalone.The easiest way to do that is to put the sounds into a folder that is inside the mainstack's folder. Or you can put the sounds loose in the mainstack's folder if you like. The important part is that the sound files are at the same level or lower than the mainstack.
LiveCode can play any sound format that QuickTime supports. But for an iOS standalone, you should not import the sounds anyway. They need to be on disk.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com