Skip to content

CocoaMiners/AppSoundEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is AppSoundEngineFramework good for?

AppSoundEngine framework brings these benefits to your app's UI sounds:

  • very low latency. It should not take more than 10 ms since you press button, and hear the sound for feeling of immediacy. AppSoundEngine achieves 2-10 ms, depending on the sound.

  • when you use System sound services, if you start playing some sound, while the other is still playing, the new sound cuts the playing one. AppSoundEngine ensures, that the new sound will not start until the old is not finished. Because System Sound Services play asynchronously, actual user actions are not slowed down waiting for sounds to finish. This enhances user experience and the app feels (and in fact is) faster.

  • super easy implementation

  • flexibility. You can choose to use only VRKSSound, and add it to your app how it suits you.

How to use it?

For lowest possible play latency, you should create the sounds during app startup, and just play them when needed.

#import "VKRSAppSoundPlayer.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [[VKRSAppSoundPlayer sharedInstance] addSoundWithFilename:@"sound1" andExtension:@"caf"];
    [[VKRSAppSoundPlayer sharedInstance] addSoundWithFilename:@"sound2" andExtension:@"caf"];
    [[VKRSAppSoundPlayer sharedInstance] setSoundsEnabled:[[NSUserDefaults standardUserDefaults] boolForKey:ASESoundsEnableSettingKey]];
}
  • just play from wherever you are
    [[VKRSAppSoundPlayer sharedInstance] playSound:@"sound1"];

Info about how to prepare sound files to work with System Sound Services is here

Thanks zoul for inspiration https://gist.github.com/205857

About

Sound engine for iOS apps with low latency. Objective C wrapper/framework of SystemSoundID, using System Sound Services functions and callbacks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published