Skip to content

Commit

Permalink
v0.2 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Nov 25, 2023
1 parent a442aa0 commit d0f364b
Show file tree
Hide file tree
Showing 92 changed files with 3,265 additions and 1,554 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ios-demos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: iOS Demos

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'demo/ios/EagleDemo/**'
- '.github/workflows/ios-demos.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- 'demo/ios/EagleDemo/**'
- '.github/workflows/ios-demos.yml'

defaults:
run:
working-directory: demo/ios/EagleDemo

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js LTS
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install Cocoapods
run: gem install cocoapods

- name: Install AppCenter CLI
run: npm install -g appcenter-cli

- name: Make build dir
run: mkdir ddp

- name: Run Cocoapods
run: pod install

- name: Build
run: xcrun xcodebuild build
-configuration Debug
-workspace EagleDemo.xcworkspace
-sdk iphoneos
-scheme EagleDemo
-derivedDataPath ddp
CODE_SIGNING_ALLOWED=NO
4 changes: 2 additions & 2 deletions .github/workflows/python-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Python Codestyle
on:
workflow_dispatch:
push:
branches: [main]
branches: [ main ]
paths:
- '**/*.py'
pull_request:
branches: [main, 'v[0-9]+.[0-9]+']
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '**/*.py'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Python Demos
on:
workflow_dispatch:
push:
branches: [main]
branches: [ main ]
paths:
- '.github/workflows/python-demos.yml'
- 'demo/python/**'
- '!demo/python/README.md'
- 'resources/audio_samples/**'
pull_request:
branches: [main, 'v[0-9]+.[0-9]+']
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/python-demos.yml'
- 'demo/python/**'
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
run: python3 -m pip install --upgrade pip

- name: Install dependencies
run: pip install -r requirements.txt
run: pip3 install -r requirements.txt

- name: Test enroll
run: >
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/python-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Python Performance
on:
workflow_dispatch:
push:
branches: [main]
branches: [ main ]
paths:
- '.github/workflows/python-perf.yml'
- 'binding/python/__init__.py'
Expand All @@ -18,7 +18,7 @@ on:
- 'lib/windows/**'
- 'resources/audio_samples/*.wav'
pull_request:
branches: [main, 'v[0-9]+.[0-9]+']
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/python-perf.yml'
- 'binding/python/__init__.py'
Expand Down Expand Up @@ -112,12 +112,8 @@ jobs:
- name: Pre-build dependencies
run: python3 -m pip install --upgrade pip

- name: Build dependencies
run: |
pip install wheel && python3 setup.py sdist bdist_wheel && pip install pip install -U dist/*.whl
- name: Install dependencies
run: pip install -r requirements.txt
run: pip3 install -r requirements.txt

- name: Test
run: >
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Python
on:
workflow_dispatch:
push:
branches: [main]
branches: [ main ]
paths:
- '.github/workflows/python.yml'
- 'binding/python/**'
Expand All @@ -16,7 +16,7 @@ on:
- 'lib/windows/**'
- 'resources/audio_samples/*.wav'
pull_request:
branches: [main, 'v[0-9]+.[0-9]+']
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/python.yml'
- 'binding/python/**'
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/web-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [16.x, 18.x]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -36,6 +36,10 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Build Web SDK
run: yarn && yarn copywasm && yarn build
working-directory: binding/web

- name: Pre-build dependencies
run: npm install yarn

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

strategy:
matrix:
node-version: [lts/*]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,17 @@ while (true) {

## Releases

### v0.2.0 - November 24th, 2023

- Improvements to error reporting
- Upgrades to authorization and authentication system
- Various bug fixes and improvements
- Web min support bumped to Node 16
- iOS support bumped to iOS 13

### v0.1.0 - May 29, 2023

- Beta release.
- Beta release

## FAQ

Expand Down
6 changes: 3 additions & 3 deletions binding/android/Eagle/eagle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

ext {
PUBLISH_GROUP_ID = 'ai.picovoice'
PUBLISH_VERSION = '0.1.1'
PUBLISH_VERSION = '0.2.0'
PUBLISH_ARTIFACT_ID = 'eagle-android'
}

Expand Down Expand Up @@ -34,12 +34,12 @@ dependencies {
}

task copyLibs(type: Copy) {
from("${rootDir}/../../lib/android")
from("${rootDir}/../../../lib/android")
into("${rootDir}/eagle/src/main/jniLibs")
}

task copyParams(type: Copy) {
from("${rootDir}/../../lib/common")
from("${rootDir}/../../../lib/common")
include('eagle_params.pv')
into("${rootDir}/eagle/src/main/res/raw")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
public class Eagle {

private static String defaultModelPath;
private static String _sdk = "android";

static {
System.loadLibrary("pv_eagle");
Expand All @@ -36,6 +37,10 @@ public class Eagle {
private long handle;
private int numSpeakers;

public static void setSdk(String sdk) {
Eagle._sdk = sdk;
}

/**
* Constructor.
*
Expand All @@ -54,6 +59,7 @@ private Eagle(
profileHandles[i] = speakerProfiles[i].profileNative.handle;
}

EagleNative.setSdk(Eagle._sdk);
handle = EagleNative.init(
accessKey,
modelPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

class EagleNative {

static native String getVersion();

static native int getFrameLength();

static native int getSampleRate();

static native String getVersion();
static native void setSdk(String sdk);

static native long init(
String accessKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ public void delete() {

private native byte[] getBytesNative(long handle, int numBytes);

private native long setBytesNative(byte[] metadataBytes, int numBytes);
private native long setBytesNative(byte[] profileBytes, int numBytes);
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
public class EagleProfiler {

private static String defaultModelPath;
private static String _sdk = "android";

private final int minEnrollSamples;

Expand All @@ -38,6 +39,10 @@ public class EagleProfiler {

private long handle;

public static void setSdk(String sdk) {
EagleProfiler._sdk = sdk;
}

/**
* Constructor.
*
Expand All @@ -46,6 +51,7 @@ public class EagleProfiler {
* @throws EagleException if there is an error while initializing EagleProfiler.
*/
private EagleProfiler(String accessKey, String modelPath) throws EagleException {
EagleNative.setSdk(EagleProfiler._sdk);
handle = EagleProfilerNative.init(accessKey, modelPath);
minEnrollSamples = EagleProfilerNative.minEnrollSamples(handle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public EagleActivationException(Throwable cause) {
public EagleActivationException(String message) {
super(message);
}

public EagleActivationException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public EagleActivationLimitException(Throwable cause) {
public EagleActivationLimitException(String message) {
super(message);
}

public EagleActivationLimitException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public EagleActivationRefusedException(Throwable cause) {
public EagleActivationRefusedException(String message) {
super(message);
}

public EagleActivationRefusedException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public EagleActivationThrottledException(Throwable cause) {
public EagleActivationThrottledException(String message) {
super(message);
}

public EagleActivationThrottledException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,42 @@
package ai.picovoice.eagle;

public class EagleException extends Exception {
private final String message;
private final String[] messageStack;

public EagleException(Throwable cause) {
super(cause);
this.message = cause.getMessage();
this.messageStack = null;
}

public EagleException(String message) {
super(message);
this.message = message;
this.messageStack = null;
}

public EagleException(String message, String[] messageStack) {
super(message);
this.message = message;
this.messageStack = messageStack;
}

public String[] getMessageStack() {
return this.messageStack;
}

@Override
public String getMessage() {
StringBuilder sb = new StringBuilder(message);
if (messageStack != null) {
if (messageStack.length > 0) {
sb.append(":");
for (int i = 0; i < messageStack.length; i++) {
sb.append(String.format("\n [%d] %s", i, messageStack[i]));
}
}
}
return sb.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public EagleIOException(Throwable cause) {
public EagleIOException(String message) {
super(message);
}

public EagleIOException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public EagleInvalidArgumentException(Throwable cause) {
public EagleInvalidArgumentException(String message) {
super(message);
}

public EagleInvalidArgumentException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ public EagleInvalidStateException(Throwable cause) {
public EagleInvalidStateException(String message) {
super(message);
}

public EagleInvalidStateException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Loading

0 comments on commit d0f364b

Please sign in to comment.