Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chenks

macrumors 65816
Original poster
Oct 23, 2007
1,232
562
UK
i'm using the AudioToolbox framework, which i'm using to play a sound when a button is pressed.

all code is working Ok and the sound plays when button is pressed.

the problem i have it that some sounds i choose don't play (code tested with another sound and it's not a code issue).

i understand that i can only use either WAV, AIF or CAF files.
i have a WAV that doesn't work, converted it to CAF still didn't work.

can anyone suggest any reason why some play and some don't?

a WAV that works is 22.8KB, 176kbps, 11.025kHz, mono, 16bit
a WAV that doesn't work is 269.5KB, 176kpbs, 11.025kHz, mono, 16bit
 
If you are using AudioServicesPlaySystemSound, the documentation says it plays a short sound (30 seconds or less in duration). How long is the sound that's not playing?
 
yes AudioServicesPlaySystemSound.

in the example above, the one that doesn't play is only 12 seconds long.
 
yes all work is done on the simulator at the moment.
 
I've read that the Simulator has a limit of 5 seconds. Trying deploying to a device and see if you still have the problem.

ahhhh. that's a bit of a strange limit to set.
makes testing just that bit more tedious.
 
well all the sounds play fine on the actual iphone.

shame the simulator can't simulate the iphone 100%.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.