I've just begun learning about Sound, and am having a little trouble in loops.
I'd like to play a system sound every time I go thru a loop. However, the code below plays only once and won't repeat in the loop. What have I done wrong?
Thank you
I'd like to play a system sound every time I go thru a loop. However, the code below plays only once and won't repeat in the loop. What have I done wrong?
Thank you
Code:
tinker = [[NSSound alloc] initWithContentsOfFile: @"/System/Library/Sounds/Tink.aiff" byReference:YES];
for(i = 0; i < 20; i++)
{
[tinker play];
usleep(90000);
}