Sound files.

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Sound files.

Post by malte » Thu Dec 09, 2010 7:58 pm

Anybody been able to add soundfiles successfully and runing in the simulator with 4.5.2?

It halts for me with an "unknown error" message.

Cheers,

Malte

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Sound files.

Post by malte » Thu Dec 09, 2010 11:01 pm

my workaround for now is to suck up the files in custom properties and spit them out to specialfolderpath("engine"). Not very elegant and requires twice the memory. I´d still appreciate any pointers.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Sound files.

Post by Klaus » Fri Dec 10, 2010 11:56 am

Hi Malte,

works on my simulator!
I added just one file (mp3 or aif, both work, probably any QT compatible format) to the iOS deplyment and used this script:
...
put the effective filename of this stack into tFilename
set itemdel to "/"
put "testsound.mp3" into item -1 of tFilename
play tFilename
...

I first tried without the path, since I thought that would be the "defaultfolder" but that did not work.
Supplying the absolute path works for me, at least in the simulator.


Best

Klaus

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Sound files.

Post by Klaus » Fri Dec 10, 2010 12:11 pm

I just discovered this extremely important info in a small sentence in the iOS release notes:

Note: Unlike (most) Mac OS X installs, the iPhoneOS filesystem is case-sensitive so take care
to ensure that you consistently use the same casing for filenames when constructing them.


Back to my project and change everything to fit into this new restriction!


Best

Klaus

cwkalish
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 78
Joined: Thu Sep 30, 2010 2:24 am

Re: Sound files.

Post by cwkalish » Fri Dec 10, 2010 5:21 pm

I have also been Having trouble getting sounds to play on iPad. I have been adding sound files as controls within live code. Will these file not work on simulator or iOS device?

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Sound files.

Post by malte » Fri Dec 10, 2010 11:49 pm

I have the files playing just fine, once I am able to get them into the simulator. Strangely though files do not get copied over once I add a file (in a subfolder besides my main stack) the simulation does not start with "unknown error" in the first place. If I put the files into cProps first and then spit them out in the simulator, they play just fine. Strange...

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Thu Jun 29, 2006 4:16 pm

Re: Sound files.

Post by Randy Hengst » Sat Dec 11, 2010 9:20 pm

I am also not able to get sounds to play in the simulator nor on a real device using the integrated iOS/4.5.2.

I've added the sounds using Import as Controls... I've double-check the case.... the sounds play in the IDE and on a Mac standalone using the format
play "mySoundfile.wav"

When using the pre-alpha plugin, sounds were loaded via the plugin and played using this format
play specialFolderPath("engine") &"/"& "mySoundfile.wav"

Sounds on my apps created with the plugin play just fine in the simulator and on real devices.

take care,
randy

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Sound files.

Post by bn » Sat Dec 11, 2010 10:49 pm

Hi Malte, Randy,

with a certain version I am not alowed to mention this works for me in the Simulator and on the iPhone:

Code: Select all

on mouseUp
   put "inhale.aif" into tSound
   put specialfolderpath("engine") & "/" into tMypath
   put tSound after tMyPath
   play  tMyPath
end mouseUp
adding the file "inhale.aif" with the Standalone Application Setting-> Copy files. This puts the file into the specialfoderPath("engine").

at least for video you have to watch out: video formats that play in the Simulator don't always work on the actual device. It depends on the encoding. This is probably also true for sounds.

Kind regards
Bernd

EDIT: I compiled the stack with Livecode 4.5.2 and above script / stack worked also.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Sound files.

Post by malte » Sun Dec 12, 2010 9:32 am

I found the cause of my issue at least.

The files are not copied with an unknown error dialogue popping up, as soon as they are in a folder relative to the source stack. If the file is not in a folder it gets copied just fine.

Will report this.

Thanks,

Malte

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Sound files.

Post by splash21 » Sun Dec 19, 2010 1:17 am

Just tried 4.5.2 iOs and created a test app. Sounds play on simulator, iPod touch and iPhone, but not iPad! The files were added using the 'Standalone application settings'. Anyone have any tips?

JC

interactbooks
Posts: 65
Joined: Thu Oct 07, 2010 4:47 pm

Re: Sound files.

Post by interactbooks » Wed Dec 22, 2010 2:56 am

From my knowledge the only sound file format that will play within an iPhone or iPad app is the CAF file format.

http://en.wikipedia.org/wiki/Core_Audio_Format

Post Reply

Return to “iOS Deployment”