Download SDK iOS/Android

iOS SDK + demo project (Objective-C and Swift)

Android SDK + demo project (Android Studio)



Integrating the iOS SDK

Step 1. Drag the RunACRSDK.framework module to your project. When prompted, select Copy items into destination group's folder.

Step 2. Go to the General settings tab of your target settings and add the framework to the Embedded Binaries section.

Step 3. For iOS 10, add description NSMicrophoneUsageDescription to your .plist file.

Step 4. Import the module using @import RunACRSDK; in order to use the library.

Step 5. The RunACRSDK must be initialized in AppDelegate's, application:didFinishLaunchingWithOptions: method
[[RunACR sharedInstance] initializeWithAPIKey:@"API_KEY"];
Add impression database file that you downloaded from runacr.com and specify it in the updateDatabasePath method:
[[RunACR sharedInstance] updateDatabasePath:path];
Specify delegate RunACRDelegateRunACRDelegate:
[RunACR sharedInstance].delegate = self;
Define two methods of RunACRDelegate protocol:
didRecognize — to receive the result of recognition processing.
didNotRecognize — to be called in case of recognition failure.
#pragma mark - RunACRDelegate
-(void)didRecognize:(int)trackId absoluteTimeOffset:(float)absoluteTimeOffset relativeTimeOffset:(float)relativeTimeOffset{

    int seconds = (int)relativeTimeOffset % 60;
    int minutes = ((int)relativeTimeOffset / 60) % 60;
    int hours = relativeTimeOffset / 3600;

    NSString *str = [NSString stringWithFormat:@"%02d:%02d:%02d",hours, minutes, seconds];

    if (trackId == 6){
        // David Bowie - The Stars 00:02:43
        _myLabel.text = [NSString stringWithFormat:@"David Bowie - The Stars %@",str];
    } else if (trackId == 7){
        // The Rolling Stones - Sympathy For The Devil 00:03:26
        _myLabel.text = [NSString stringWithFormat:@"The Rolling Stones - Sympathy For The Devil %@",str];
    }
}


-(void)didNotRecognize{
    // Not found. Try again.
    [[RunACR sharedInstance] startRecognize];
}
            
To start recognition processing, call the startRecognize method.
[[RunACR sharedInstance] startRecognize];
Download the test project for iOS



Integrating the Android SDK

RunACR Android SDK is an AAR library and it is available from jCenter repository.

Step 1. If you are using Gradle Build Tool, include dependency in build.gradle file:

dependencies {
    // RunACR from jcenter
    compile 'com.runacr.android:android-runacr-sdk:1.0.4'
}
If you are not using Gradle Build Tool, just download and include runacrsdk-release-1.0.4.aar library to your project.


Step 2. Initialize library in your app by calling init function. Pass Api key, fingerprint file path and initialization callback:

RunACR.init(this, "Your api key", "Path to .runacr file",
       new InitListener() {

           @Override
           public void onSuccess() {
               //Ready to recognize
           }

           ...
       });



Step 3. Run audio recognition by calling recognize method and passing the callback RecognizeListener into it. You result will be in RecognizeResult object.

RunACR.recognize(new RecognizeListener() {

    @Override
    public void onSuccess(RecognizeResult recognizeResult) {
        // Recognized track id - recognizeResult.id
        // Absolute offset - recognizeResult.absoluteTimeOffset
        // Relative offset - recognizeResult.relativeTimeOffset
    }

    @Override
    public void onFailure ( final int errorCode ) {
        // Not found. Try again.
    }

    ...
});
For more information please download sample project showing full workflow of RunACR SDK.