Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0 #49

Merged
merged 38 commits into from
Nov 25, 2023
Merged

v2.0 #49

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bb3a1b0
update koala libs
ksyeo1010 Oct 30, 2023
0af14bc
update model
ksyeo1010 Oct 30, 2023
3d02464
python
laves Oct 27, 2023
8f5c12f
fix'
laves Oct 27, 2023
8bd86a7
fix
laves Oct 27, 2023
c668825
demo updates
laves Oct 30, 2023
6c87baa
fix setup
laves Oct 30, 2023
389106c
web
laves Oct 30, 2023
e7e446b
fix
laves Oct 30, 2023
8573184
fix
laves Oct 30, 2023
2fd9bb1
lint
laves Oct 30, 2023
4d4a906
back to promise
laves Oct 31, 2023
bb837a7
Update demo/c/koala_demo_file.c
laves Oct 31, 2023
e465af6
Merge pull request #34 from Picovoice/v2.0-c
mrrostam Oct 31, 2023
cbdd04f
Merge pull request #33 from Picovoice/v2.0-python
ksyeo1010 Oct 31, 2023
aaed1db
fix typo (#38)
ksyeo1010 Oct 31, 2023
bb2151e
v2.0 android (#36)
ksyeo1010 Nov 1, 2023
30a96d5
update api (#39)
ksyeo1010 Nov 1, 2023
3746dcc
v2.0 ios (#37)
ksyeo1010 Nov 1, 2023
6c92f41
update repo
ksyeo1010 Nov 2, 2023
4c7377f
Merge pull request #42 from Picovoice/v2.0-version
ksyeo1010 Nov 3, 2023
d1bf940
v2.0 tests (#40)
ksyeo1010 Nov 3, 2023
d5e3765
fix koala + koala test
ksyeo1010 Nov 3, 2023
60c443a
improvements
laves Nov 3, 2023
9c93a76
v2.0 ios update (#41)
ksyeo1010 Nov 3, 2023
c135a82
add sdk to worker
laves Nov 3, 2023
22580b6
Merge pull request #35 from Picovoice/v2.0-web
ksyeo1010 Nov 6, 2023
4395d35
patch libs (#43)
laves Nov 17, 2023
b339c70
android patch libs (#44)
laves Nov 20, 2023
7eab270
v2.0 web release (#46)
laves Nov 24, 2023
64b1f82
v2.0 android release
ksyeo1010 Nov 24, 2023
182700c
v2.0 ios release
ksyeo1010 Nov 24, 2023
589c92e
v2.0 python release (#45)
laves Nov 24, 2023
9c1fa20
Merge pull request #47 from Picovoice/v2.0-android-release
ksyeo1010 Nov 24, 2023
3ccf6fb
Merge pull request #48 from Picovoice/v2.0-ios-release
ksyeo1010 Nov 24, 2023
46be150
final touches
laves Nov 24, 2023
8f4f933
update header
laves Nov 24, 2023
097c74b
web perf (#50)
laves Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Check Markdown links
on:
workflow_dispatch:
push:
branches: [main]
branches: [ main ]
pull_request:
branches: [main, 'v[0-9]+.[0-9]+']
branches: [ main, 'v[0-9]+.[0-9]+' ]

jobs:
markdown-link-check:
Expand Down
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
4 changes: 2 additions & 2 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/test.wav'
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
4 changes: 2 additions & 2 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/test.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
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 @@ -17,7 +17,7 @@ on:
- 'resources/audio_samples/noise.wav'
- 'resources/audio_samples/test.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
4 changes: 2 additions & 2 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: SpellCheck
on:
workflow_dispatch:
push:
branches: [main]
branches: [ main ]
pull_request:
branches: [main, 'v[0-9]+.[0-9]+']
branches: [ main, 'v[0-9]+.[0-9]+' ]

jobs:
spellcheck:
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 @@ -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,6 +35,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-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
run: yarn setup-test

- name: Test
run: yarn test-perf --env ACCESS_KEY=${{secrets.PV_VALID_ACCESS_KEY}},NUM_TEST_ITERATIONS=20,PROC_PERFORMANCE_THRESHOLD_SEC=0.8
run: yarn test-perf --env ACCESS_KEY=${{secrets.PV_VALID_ACCESS_KEY}},NUM_TEST_ITERATIONS=15,PROC_PERFORMANCE_THRESHOLD_SEC=${{ matrix.procPerformanceThresholdSec }}
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: [14.x, 16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ Replace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://con

## Releases

### v1.0.0 February 7th, 2023
### v2.0.0 - November 24th, 2023

- Initial release.
- 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.0.0 - February 7th, 2023

- Initial release
6 changes: 3 additions & 3 deletions binding/android/Koala/koala/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.0.0'
PUBLISH_VERSION = '2.0.0'
PUBLISH_ARTIFACT_ID = 'koala-android'
}

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

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

task copyParams(type: Copy) {
from("${rootDir}/../../lib/common")
from("${rootDir}/../../../lib/common")
into("${rootDir}/koala/src/main/res/raw")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@
public class Koala {

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

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

private long handle;

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

/**
* Constructor.
*
Expand All @@ -43,6 +48,7 @@ public class Koala {
* @throws KoalaException if there is an error while initializing Koala.
*/
private Koala(String accessKey, String modelPath) throws KoalaException {
KoalaNative.setSdk(Koala._sdk);
handle = KoalaNative.init(accessKey, modelPath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@

class KoalaNative {

static native int getSampleRate();

static native String getVersion();

static native int getFrameLength();

static native int getSampleRate();

static native void setSdk(String sdk);

static native long init(String accessKey, String modelPath) throws KoalaException;

static native void delete(long object);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
Copyright 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
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
Expand All @@ -18,5 +20,8 @@ public KoalaActivationException(Throwable cause) {
public KoalaActivationException(String message) {
super(message);
}
}

public KoalaActivationException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
Copyright 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
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
Expand All @@ -18,5 +20,8 @@ public KoalaActivationLimitException(Throwable cause) {
public KoalaActivationLimitException(String message) {
super(message);
}
}

public KoalaActivationLimitException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
Copyright 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
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
Expand All @@ -18,5 +20,8 @@ public KoalaActivationRefusedException(Throwable cause) {
public KoalaActivationRefusedException(String message) {
super(message);
}
}

public KoalaActivationRefusedException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
Copyright 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
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
Expand All @@ -18,5 +20,8 @@ public KoalaActivationThrottledException(Throwable cause) {
public KoalaActivationThrottledException(String message) {
super(message);
}
}

public KoalaActivationThrottledException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
Copyright 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
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
Expand All @@ -11,12 +13,42 @@
package ai.picovoice.koala;

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

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

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

public KoalaException(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,7 +1,9 @@
/*
Copyright 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
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
Expand All @@ -18,5 +20,8 @@ public KoalaIOException(Throwable cause) {
public KoalaIOException(String message) {
super(message);
}
}

public KoalaIOException(String message, String[] messageStack) {
super(message, messageStack);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/*
Copyright 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
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and
Expand All @@ -18,5 +20,8 @@ public KoalaInvalidArgumentException(Throwable cause) {
public KoalaInvalidArgumentException(String message) {
super(message);
}
}

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