PDA

View Full Version : sounds don't work right in simulator




ccyork
Aug 11, 2008, 01:36 PM
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:@"wav"];
NSURL *url = [NSURL fileURLWithPath:soundFile];
OSStatus error = AudioServicesCreateSystemSoundID( (CFURLRef) url, &soundID );
AudioServicesPlaySystemSound(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



firewood
Aug 11, 2008, 04:05 PM
Same here. The simulator puts clicks in my music synthesizer output, but the real device doesn't.

meonfire
Sep 28, 2008, 04:04 AM
If you take a quick look to the GLPaint demo you will see how easily sounds get implemented with no errors. :D

firewood
Sep 28, 2008, 12:53 PM
Same here. The simulator puts clicks in my music synthesizer output, but the real device doesn't.

I've noticed this also, not only with synthesized output, but with recording audio as well.

mevdev
Jan 3, 2009, 07:06 PM
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).