-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
2,694 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Android AppCenter Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/android-appcenter.yml' | ||
- 'demo/android/Activity/**' | ||
- '!demo/android/Activity/README.md' | ||
- 'resources/audio_samples/**' | ||
pull_request: | ||
branches: [ main, 'v[0-9]+.[0-9]+'] | ||
paths: | ||
- '.github/workflows/android-appcenter.yml' | ||
- 'demo/android/Activity/**' | ||
- '!demo/android/Activity/README.md' | ||
- 'resources/audio_samples/**' | ||
|
||
defaults: | ||
run: | ||
working-directory: demo/android/Activity | ||
|
||
jobs: | ||
build: | ||
name: Run Android Tests on AppCenter | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
|
||
- name: Install AppCenter CLI | ||
run: npm install -g appcenter-cli | ||
|
||
- name: set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Binding pre-build | ||
run: ./gradlew assemble | ||
working-directory: binding/android | ||
|
||
- name: Copy test_resources | ||
run: ./copy_test_resources.sh | ||
|
||
- name: Inject AccessKey | ||
run: echo pvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" >> local.properties | ||
|
||
- name: Build app | ||
run: ./gradlew assembleDebug | ||
|
||
- name: Build androidTest | ||
run: ./gradlew assembleAndroidTest | ||
|
||
- name: Run tests on AppCenter | ||
run: appcenter test run espresso | ||
--token ${{secrets.APPCENTERAPITOKEN}} | ||
--app "Picovoice/Koala-Android" | ||
--devices "Picovoice/android-min-max" | ||
--app-path koala-activity-demo-app/build/outputs/apk/debug/koala-activity-demo-app-debug.apk | ||
--test-series "koala-android" | ||
--locale "en_US" | ||
--build-dir koala-activity-demo-app/build/outputs/apk/androidTest/debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Android Performance | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/android-perf.yml' | ||
- 'lib/android/**' | ||
- 'lib/common/**' | ||
- 'resources/audio_samples/**' | ||
pull_request: | ||
branches: [ main, 'v[0-9]+.[0-9]+'] | ||
paths: | ||
- '.github/workflows/android-perf.yml' | ||
- 'lib/android/**' | ||
- 'lib/common/**' | ||
- 'resources/audio_samples/**' | ||
|
||
defaults: | ||
run: | ||
working-directory: demo/android/Activity | ||
|
||
jobs: | ||
build: | ||
name: Run Android Speed Tests on AppCenter | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
device: [single-android, 32bit-android] | ||
include: | ||
- device: single-android | ||
performanceThresholdSec: 0.4 | ||
- device: 32bit-android | ||
performanceThresholdSec: 3.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
|
||
- name: Install AppCenter CLI | ||
run: npm install -g appcenter-cli | ||
|
||
- name: set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Copy test_resources | ||
run: ./copy_test_resources.sh | ||
|
||
- name: Inject AccessKey | ||
run: echo pvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" >> local.properties | ||
|
||
- name: Inject Number of Iterations | ||
run: echo numTestIterations="30" >> local.properties | ||
|
||
- name: Inject Proc Performance Threshold | ||
run: echo performanceThresholdSec="${{ matrix.performanceThresholdSec }}" >> local.properties | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build app | ||
run: ./gradlew assembleDebug | ||
|
||
- name: Build androidTest | ||
run: ./gradlew assembleAndroidTest | ||
|
||
- name: Run tests on AppCenter | ||
run: appcenter test run espresso | ||
--token ${{secrets.APPCENTERAPITOKEN}} | ||
--app "Picovoice/Koala-Android" | ||
--devices "Picovoice/${{ matrix.device }}" | ||
--app-path koala-activity-demo-app/build/outputs/apk/debug/koala-activity-demo-app-debug.apk | ||
--test-series "koala-android" | ||
--locale "en_US" | ||
--build-dir koala-activity-demo-app/build/outputs/apk/androidTest/debug | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/ | ||
.DS_Store | ||
/build | ||
/captures | ||
test_resources | ||
.settings | ||
.classpath | ||
.project | ||
publish-mavencentral.gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Koala Binding for Android | ||
|
||
## Koala Noise Suppression Engine | ||
|
||
Made in Vancouver, Canada by [Picovoice](https://picovoice.ai) | ||
|
||
Koala is an on-device noise suppression engine. Koala is: | ||
|
||
- Private; All voice processing runs locally. | ||
- Cross-Platform: | ||
- Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64) | ||
- Android and iOS | ||
- Chrome, Safari, Firefox, and Edge | ||
- Raspberry Pi (4, 3) and NVIDIA Jetson Nano | ||
|
||
## Compatibility | ||
|
||
- Android 5.0 (SDK 21+) | ||
|
||
## Installation | ||
|
||
Koala is hosted on Maven Central. To include the package in your Android project, ensure you have | ||
included `mavenCentral()` in your top-level `build.gradle` file and then add the following to your | ||
app's `build.gradle`: | ||
|
||
```groovy | ||
dependencies { | ||
// ... | ||
implementation 'ai.picovoice:koala-android:${VERSION}' | ||
} | ||
``` | ||
|
||
## AccessKey | ||
|
||
Koala requires a valid Picovoice `AccessKey` at initialization. `AccessKey` acts as your credentials when using Koala SDKs. | ||
You can get your `AccessKey` for free. Make sure to keep your `AccessKey` secret. | ||
Signup or Login to [Picovoice Console](https://console.picovoice.ai/) to get your `AccessKey`. | ||
|
||
## Usage | ||
|
||
Create an instance of the engine with the Koala Builder class by passing in the `accessKey` and Android app context: | ||
|
||
```java | ||
import ai.picovoice.koala.*; | ||
|
||
final String accessKey = "${ACCESS_KEY}"; // AccessKey provided by Picovoice Console (https://console.picovoice.ai/) | ||
try { | ||
Koala koala = new Koala.Builder() | ||
.setAccessKey(accessKey) | ||
.build(appContext); | ||
} catch (KoalaException ex) { } | ||
``` | ||
|
||
Enhance audio: | ||
|
||
```java | ||
short[] getNextAudioFrame() { | ||
// .. get audioFrame | ||
return audioFrame; | ||
} | ||
|
||
while true { | ||
short[] enhancedFrame = koala.process(getNextAudioFrame()); | ||
} | ||
``` | ||
|
||
In case the next audio frame does not directly follow the previous one, call `reset()`: | ||
```java | ||
koala.reset(); | ||
``` | ||
|
||
When done, resources have to be released explicitly: | ||
|
||
```java | ||
koala.delete(); | ||
``` | ||
|
||
## Demo App | ||
|
||
For example usage refer to our [Android demo application](../../demo/android). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ext { | ||
defaultTargetSdkVersion = 31 | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
maven { url "https://plugins.gradle.org/m2/" } | ||
google() | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath "com.android.tools.build:gradle:4.2.2" | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Project-wide Gradle settings. | ||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 | ||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true | ||
# AndroidX package structure to make it clearer which packages are bundled with the | ||
# Android operating system, and which are packaged with your app"s APK | ||
# https://developer.android.com/topic/libraries/support-library/androidx-rn | ||
android.useAndroidX=true |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Tue Jun 29 22:27:49 PDT 2021 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
Oops, something went wrong.