Skip to content

Commit

Permalink
v3.0 (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Oct 26, 2023
1 parent 6b60b34 commit e650373
Show file tree
Hide file tree
Showing 1,277 changed files with 21,653 additions and 18,635 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/angular-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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
2 changes: 1 addition & 1 deletion .github/workflows/angular.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: demo/dotnet-vui/
working-directory: demo/dotnet-vui/AvaloniaVUI

strategy:
matrix:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/go-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
go: [ '1.16', '1.17', '1.18' ]
go: [ '1.16', '1.17', '1.18', '1.19', '1.20', 'stable' ]

steps:
- uses: actions/checkout@v3

- name: Set up Mingw
uses: egor-tensin/setup-mingw@v2
if: ${{ (matrix.os == 'windows-latest') && (matrix.go != 'stable') && (matrix.go < 1.20) }}
with:
version: 11.2.0

- name: Set up go
uses: actions/setup-go@v4
with:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
go: [ '1.16', '1.17', '1.18' ]
go: [ '1.16', '1.17', '1.18', '1.19', '1.20', 'stable' ]

steps:
- uses: actions/checkout@v3

- name: Set up Mingw
uses: egor-tensin/setup-mingw@v2
if: ${{ (matrix.os == 'windows-latest') && (matrix.go != 'stable') && (matrix.go < 1.20) }}
with:
version: 11.2.0

- name: Set up go
uses: actions/setup-go@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
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
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
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
2 changes: 1 addition & 1 deletion .github/workflows/react-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 Down
20 changes: 16 additions & 4 deletions .github/workflows/react-native-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Pre-build dependencies
run: npm install yarn
# ************ REMOVE AFTER RELEASE *****************
- name: Build and package binding
working-directory: binding/react-native
run: yarn && yarn pkg

- name: Add to demo
run: yarn add ../../binding/react-native/pkg/picovoice-porcupine-react-native-3.0.0.tgz
# ***************************************************

- name: Install dependencies
run: yarn android-install
Expand All @@ -63,8 +69,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Pre-build dependencies
run: npm install yarn
# ************ REMOVE AFTER RELEASE *****************
- name: Build and package binding
working-directory: binding/react-native
run: yarn && yarn pkg

- name: Add to demo
run: yarn add ../../binding/react-native/pkg/picovoice-porcupine-react-native-3.0.0.tgz
# ***************************************************

- name: Install dependencies
run: yarn ios-install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/react-native-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Cocoapods install
working-directory: binding/react-native/test-app/PorcupineTestApp/ios
run: pod install
run: pod install --repo-update

- name: Inject AppID
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:' Tests.ts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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
50 changes: 22 additions & 28 deletions .github/workflows/unity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,38 +65,35 @@ jobs:
Assets/Porcupine/Tests/Integration.cs

- name: Run tests
run: xvfb-run --auto-servernum --server-args='-screen 0 640x480x24'
/home/picovoice/Unity/Hub/Editor/2019.4.34f1/Editor/Unity -runTests -batchmode -projectPath . -testResults unityresults.xml -testPlatform StandaloneLinux64 -logFile -
run: xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' /home/picovoice/Unity/Hub/Editor/2021.3.31f1/Editor/Unity -runTests -batchmode -projectPath . -testResults unityresults.xml -testPlatform StandaloneLinux64 -logFile -

- name: Check Results
run: sed -n 2p unityresults.xml | grep 'result="Passed"'

playtest-mac:
name: Run PlayTest unit tests on macOS
runs-on: pv-ios
# NOTE: fix later as mac runner halts unity test app in between runs. Running locally works fine as well as first try after restarting runner.
# playtest-mac:
# name: Run PlayTest unit tests on macOS
# runs-on: pv-ios

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: 'recursive'

- name: Pre-build dependencies
run: |
./copy.sh
./copy_test_resources.sh
# - name: Pre-build dependencies
# run: |
# ./copy.sh
# ./copy_test_resources.sh

- name: Clean conflicting dylib
run: rm -rf Assets/Porcupine/Plugins/mac/arm64
# - name: Inject AppID
# run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
# Assets/Porcupine/Tests/Integration.cs

- name: Inject AppID
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
Assets/Porcupine/Tests/Integration.cs

- name: Run tests
run: /Applications/Unity/Hub/Editor/2019.4.34f1/Unity.app/Contents/MacOS/Unity -runTests -batchmode -projectPath . -testResults unityresults.xml -testPlatform StandaloneOSX -logFile -
# - name: Run tests
# run: /Applications/Unity/Hub/Editor/2021.3.31f1/Unity.app/Contents/MacOS/Unity -runTests -batchmode -projectPath . -testResults unityresults.xml -testPlatform StandaloneOSX -logFile -

- name: Check Results
run: sed -n 2p unityresults.xml | grep 'result="Passed"'
# - name: Check Results
# run: sed -n 2p unityresults.xml | grep 'result="Passed"'

playtest-windows:
name: Run PlayTest unit tests on Windows
Expand All @@ -120,7 +117,7 @@ jobs:

- name: Run tests
run: >
& "C:\Program Files\Unity\Hub\Editor\2019.4.34f1\Editor\Unity.exe" -runTests -batchmode -projectPath . -testResults unityresults.xml -testPlatform StandaloneWindows64 -logFile - | Out-Host
& "C:\Program Files\Unity\Hub\Editor\2021.3.31f1\Editor\Unity.exe" -runTests -batchmode -projectPath . -testResults unityresults.xml -testPlatform StandaloneWindows64 -logFile - | Out-Host
- name: Check Results
run: bash -c "sed -n 2p unityresults.xml | grep Passed"
Expand All @@ -139,9 +136,6 @@ jobs:
./copy.sh
./copy_test_resources.sh
- name: Clean conflicting dylib
run: rm -rf Assets/Porcupine/Plugins/mac/arm64

- name: Inject AppID
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
Assets/Porcupine/Tests/Integration.cs
Expand All @@ -150,7 +144,7 @@ jobs:
run: /Users/alirezakenarsari-anhari/Library/Android/sdk/emulator/emulator -avd Pixel_6_API_33 &

- name: Run tests
run: /Applications/Unity/Hub/Editor/2019.4.34f1/Unity.app/Contents/MacOS/Unity -runTests -batchmode -projectPath . -testResults unityresults.xml -testPlatform Android -logFile -
run: /Applications/Unity/Hub/Editor/2021.3.31f1/Unity.app/Contents/MacOS/Unity -runTests -batchmode -buildTarget Android -projectPath . -testResults unityresults.xml -testPlatform Android -logFile -

- name: Check Results
run: sed -n 2p unityresults.xml | grep 'result="Passed"'
2 changes: 1 addition & 1 deletion .github/workflows/vue-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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
2 changes: 1 addition & 1 deletion .github/workflows/vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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
2 changes: 1 addition & 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 Down
2 changes: 1 addition & 1 deletion .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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
2 changes: 1 addition & 1 deletion binding/android/Porcupine/porcupine/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 = '2.2.2'
PUBLISH_VERSION = '3.0.0'
PUBLISH_ARTIFACT_ID = 'porcupine-android'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021-2022 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.
Expand Down Expand Up @@ -43,13 +43,18 @@ public class Porcupine {

private static String DEFAULT_MODEL_PATH;
private static boolean isExtracted;
private static String _sdk = "android";

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

private long handle;

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

/**
* Constructor.
*
Expand All @@ -66,6 +71,8 @@ private Porcupine(
String modelPath,
String[] keywordPaths,
float[] sensitivities) throws PorcupineException {
PorcupineNative.setSdk(Porcupine._sdk);

handle = PorcupineNative.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 @@ -20,6 +20,8 @@ class PorcupineNative {

static native int getSampleRate();

static native void setSdk(String sdk);

static native long init(
String accessKey,
String modelPath,
Expand All @@ -31,5 +33,4 @@ static native long init(
static native int process(
long object,
short[] pcm) throws PorcupineException;

}
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,4 +18,8 @@ public PorcupineActivationException(Throwable cause) {
public PorcupineActivationException(String message) {
super(message);
}

public PorcupineActivationException(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,4 +18,8 @@ public PorcupineActivationLimitException(Throwable cause) {
public PorcupineActivationLimitException(String message) {
super(message);
}

public PorcupineActivationLimitException(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,4 +18,8 @@ public PorcupineActivationRefusedException(Throwable cause) {
public PorcupineActivationRefusedException(String message) {
super(message);
}

public PorcupineActivationRefusedException(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,4 +18,8 @@ public PorcupineActivationThrottledException(Throwable cause) {
public PorcupineActivationThrottledException(String message) {
super(message);
}

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

0 comments on commit e650373

Please sign in to comment.