sounds don't work right in simulator

Discussion in 'iOS Programming' started by ccyork, Aug 11, 2008.

  1. ccyork macrumors newbie

    Aug 7, 2008
    this is more of an observation than a question. i use the following method to play short sound effects in my game:

    -(void) playSound: (id) fileName
    SystemSoundID soundID;
    NSString *soundFile = [[NSBundle mainBundle] pathForResource:fileName ofType:mad:"wav"];
    NSURL *url = [NSURL fileURLWithPath:soundFile];
    OSStatus error = AudioServicesCreateSystemSoundID( (CFURLRef) url, &soundID );


    interestingly the simulator intermittently gives me an error 1501 without playing the sound. my iPod Touch ALWAYS plays the sound correctly

    so if something doesn't seem to work right in the simulator, give it a try on the real device. it just might work
  2. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    Same here. The simulator puts clicks in my music synthesizer output, but the real device doesn't.
  3. meonfire macrumors newbie

    Sep 28, 2008

    If you take a quick look to the GLPaint demo you will see how easily sounds get implemented with no errors. :D
  4. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    I've noticed this also, not only with synthesized output, but with recording audio as well.
  5. mevdev macrumors newbie

    Dec 26, 2005
    I find the same thing

    I've used the EXACT code as in the SysSound and also another demo. I even tried to use the same sound file it didn't work in the simulator. Seemingly every time it still works on my ipod touch.

    This is my only issue (well besides the frameworks getting all f'd in the latest sdk).

Share This Page