soundEffectNamed:inBundle: can't load files with extension
Opened this issue · 2 comments
warpling commented
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];
soffes commented
Do aif
files even work? Last I looked (which was awhile ago) it had to be a caf
.
warpling commented
Aifs work! I was wondering why the library defaulted to caf if an extension wasn't provided.