soffes / SAMSoundEffect

Play a sound effect
MIT License
135 stars 7 forks source link

soundEffectNamed:inBundle: can't load files with extension #6

Open warpling opened 9 years ago

warpling commented 9 years ago

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 9 years ago

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

warpling commented 9 years ago

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