soffes/SAMSoundEffect

soundEffectNamed:inBundle: can't load files with extension

Opened this issue · 2 comments

It appears if I call
[SAMSoundEffect playSoundEffectNamed:@"click.aif"];

then in soundEffectNamed:inBundle: fileName will equal @"click.aif" and fileExtension will equal @"aif" causing [bundleOrNil pathForResource:fileName ofType:fileExtension] to return nil.

The fix as far as I can tell is to change the fileName assignment to something like:
NSString *fileName = [[name lastPathComponent] stringByDeletingPathExtension];

Do aif files even work? Last I looked (which was awhile ago) it had to be a caf.

Aifs work! I was wondering why the library defaulted to caf if an extension wasn't provided.