Skip to content

Commit

Permalink
v2.0 (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Nov 25, 2023
1 parent 59d9d65 commit 0f48f80
Show file tree
Hide file tree
Showing 116 changed files with 2,315 additions and 956 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
device: [single-android, 32bit-android]
include:
- device: single-android
indexPerformanceThresholdSec: 1.5
searchPerformanceThresholdSec: 0.004
indexPerformanceThresholdSec: 4.0
searchPerformanceThresholdSec: 0.008
- device: 32bit-android
indexPerformanceThresholdSec: 8
searchPerformanceThresholdSec: 0.004
indexPerformanceThresholdSec: 14
searchPerformanceThresholdSec: 0.0048

steps:
- uses: actions/checkout@v3
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ios-appcenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ jobs:
-derivedDataPath ddp
CODE_SIGNING_ALLOWED=NO

- name: Run Tests on AppCenter
run: appcenter test run xcuitest
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Octopus-iOS"
--devices "Picovoice/ios-min-max"
--test-series "octopus-ios"
--locale "en_US"
--build-dir ddp/Build/Products/Debug-iphoneos
# - name: Run Tests on AppCenter
# run: appcenter test run xcuitest
# --token ${{secrets.APPCENTERAPITOKEN}}
# --app "Picovoice/Octopus-iOS"
# --devices "Picovoice/ios-min-max"
# --test-series "octopus-ios"
# --locale "en_US"
# --build-dir ddp/Build/Products/Debug-iphoneos
6 changes: 3 additions & 3 deletions .github/workflows/python-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
index_performance_threshold_sec: 1.4
index_performance_threshold_sec: 2.2
search_performance_threshold_sec: 0.001
- os: windows-latest
index_performance_threshold_sec: 1.4
index_performance_threshold_sec: 2.2
search_performance_threshold_sec: 0.001
- os: macos-latest
index_performance_threshold_sec: 2.0
index_performance_threshold_sec: 2.8
search_performance_threshold_sec: 0.001

steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/web-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
with:
node-version: lts/*

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

- name: Run Binding Linter
run: yarn && yarn lint
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/web-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -35,8 +35,5 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

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

- name: Install dependencies
run: yarn install
5 changes: 1 addition & 4 deletions .github/workflows/web-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
matrix:
node-version: [lts/*]
include:
- indexPerformanceThresholdSec: 1.8
- indexPerformanceThresholdSec: 2.4
searchPerformanceThresholdSec: 0.015

steps:
Expand All @@ -38,9 +38,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

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

- name: Install dependencies
run: yarn install

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x]

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

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

- name: Install dependencies
run: yarn install

Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,23 @@ Replace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://con

## Releases

### v1.2.0 August 11th, 2022
### v2.0.0 - November 24th, 2023

* added language support for French, German, Spanish, Japanese, Korean, Italian, and Portuguese
* improved testing infrastructure
- 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

### v1.2.0 - August 11th, 2022

- Added language support for French, German, Spanish, Japanese, Korean, Italian, and Portuguese.
- Improved testing infrastructure

### v1.1.0 May 12th, 2022

* various bug fixes and improvements
- Various bug fixes and improvements

### v1.0.0 October 8th, 2021

* Initial release.
- Initial release
6 changes: 3 additions & 3 deletions binding/android/Octopus/octopus/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 = '1.2.2'
PUBLISH_VERSION = '2.0.0'
PUBLISH_ARTIFACT_ID = 'octopus-android'
}

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

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

task copyParams(type: Copy) {
from("${rootDir}/../../lib/common/param")
from("${rootDir}/../../../lib/common/param")
include('octopus_params.pv')
into("${rootDir}/octopus/src/main/res/raw")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand Down Expand Up @@ -30,12 +30,17 @@
public class Octopus {

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

private long handle;

static {
System.loadLibrary("pv_octopus");
}

private long handle;
public static void setSdk(String sdk) {
Octopus._sdk = sdk;
}

/**
* Constructor.
Expand All @@ -45,6 +50,7 @@ public class Octopus {
* @throws OctopusException if there is an error while initializing Octopus.
*/
private Octopus(String accessKey, String modelPath) throws OctopusException {
OctopusNative.setSdk(Octopus._sdk);
handle = OctopusNative.init(accessKey, modelPath);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2022 Picovoice Inc.
Copyright 2022-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Expand All @@ -14,9 +14,11 @@

class OctopusNative {

static native String getVersion();

static native int getPcmDataSampleRate();

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
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -18,5 +18,9 @@ public OctopusActivationException(Throwable cause) {
public OctopusActivationException(String message) {
super(message);
}

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -18,5 +18,9 @@ public OctopusActivationLimitException(Throwable cause) {
public OctopusActivationLimitException(String message) {
super(message);
}

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -18,5 +18,9 @@ public OctopusActivationRefusedException(Throwable cause) {
public OctopusActivationRefusedException(String message) {
super(message);
}

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -18,5 +18,9 @@ public OctopusActivationThrottledException(Throwable cause) {
public OctopusActivationThrottledException(String message) {
super(message);
}

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -11,12 +11,43 @@
package ai.picovoice.octopus;

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

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

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

public OctopusException(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
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -18,5 +18,9 @@ public OctopusIOException(Throwable cause) {
public OctopusIOException(String message) {
super(message);
}

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -18,5 +18,9 @@ public OctopusInvalidArgumentException(Throwable cause) {
public OctopusInvalidArgumentException(String message) {
super(message);
}

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 Picovoice Inc.
Copyright 2021-2023 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is
located in the "LICENSE" file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the
Expand All @@ -18,5 +18,9 @@ public OctopusInvalidStateException(Throwable cause) {
public OctopusInvalidStateException(String message) {
super(message);
}

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

Loading

0 comments on commit 0f48f80

Please sign in to comment.