AudioToolbox framework help

Discussion in 'iOS Programming' started by chenks, Aug 7, 2009.

  1. chenks macrumors 6502a

    chenks

    Joined:
    Oct 23, 2007
    Location:
    UK
    #1
    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
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    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?
     
  3. chenks thread starter macrumors 6502a

    chenks

    Joined:
    Oct 23, 2007
    Location:
    UK
    #3
    yes AudioServicesPlaySystemSound.

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

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Are you having this issue when playing the sound on the Simulator?
     
  5. chenks thread starter macrumors 6502a

    chenks

    Joined:
    Oct 23, 2007
    Location:
    UK
    #5
    yes all work is done on the simulator at the moment.
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    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.
     
  7. chenks thread starter macrumors 6502a

    chenks

    Joined:
    Oct 23, 2007
    Location:
    UK
    #7
    ahhhh. that's a bit of a strange limit to set.
    makes testing just that bit more tedious.
     
  8. chenks thread starter macrumors 6502a

    chenks

    Joined:
    Oct 23, 2007
    Location:
    UK
    #8
    well all the sounds play fine on the actual iphone.

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

Share This Page