PDA

View Full Version : AudioToolbox framework help




chenks
Aug 7, 2009, 10:33 AM
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



dejo
Aug 7, 2009, 10:39 AM
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?

chenks
Aug 7, 2009, 10:41 AM
yes AudioServicesPlaySystemSound.

in the example above, the one that doesn't play is only 12 seconds long.

dejo
Aug 7, 2009, 10:45 AM
Are you having this issue when playing the sound on the Simulator?

chenks
Aug 7, 2009, 10:46 AM
yes all work is done on the simulator at the moment.

dejo
Aug 7, 2009, 10:49 AM
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.

chenks
Aug 7, 2009, 10:50 AM
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.

chenks
Aug 8, 2009, 07:37 AM
well all the sounds play fine on the actual iphone.

shame the simulator can't simulate the iphone 100%.