Skip to content

Commit

Permalink
v3.0 (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Oct 26, 2023
1 parent bb26c9e commit b6cb26b
Show file tree
Hide file tree
Showing 481 changed files with 12,095 additions and 9,910 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/angular-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/angular.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
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

- name: Dotnet build micdemo
run: dotnet build -c MicDemo.Release

- name: Dotnet build filedemo
run: dotnet build -c FileDemo.Release

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:

- name: Dotnet build micdemo
run: dotnet build -c MicDemo.Release

- name: Dotnet build filedemo
run: dotnet build -c FileDemo.Release

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,7 +27,7 @@ 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' ]
include:
- os: ubuntu-latest
platform: linux
Expand All @@ -39,6 +39,12 @@ jobs:
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, macos-latest, windows-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: Setup 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]
include:
- os: ubuntu-latest
platform: linux
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-rhino-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-rhino-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 @@ -73,7 +73,7 @@ jobs:
- name: Cocoapods install
working-directory: binding/react-native/test-app/RhinoTestApp/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 @@ -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
4 changes: 4 additions & 0 deletions .github/workflows/rust-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
toolchain: stable
override: true

- name: Rust build binding
run: bash copy.sh && cargo build --verbose
working-directory: binding/rust

- name: Run clippy
run: cargo clippy -- -D warnings
working-directory: binding/rust
Expand Down
47 changes: 23 additions & 24 deletions .github/workflows/unity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,35 @@ jobs:
Assets/Rhino/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: Clean conflicting dylib
run: rm -rf Assets/Rhino/Plugins/mac/arm64
# - name: Pre-build dependencies
# run: |
# ./copy.sh
# ./copy_test_resources.sh

- name: Inject AppID
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
Assets/Rhino/Tests/Integration.cs
# - name: Inject AppID
# run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
# Assets/Rhino/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 @@ -117,7 +115,8 @@ 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 Down Expand Up @@ -145,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 @@ -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/vue.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/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 @@ -35,7 +35,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/Rhino/rhino/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 = 'rhino-android'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2018-2022 Picovoice Inc.
Copyright 2018-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 @@ -34,6 +34,7 @@ public class Rhino {

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

static {
System.loadLibrary("pv_rhino");
Expand All @@ -42,6 +43,10 @@ public class Rhino {
private long handle;
private boolean isFinalized;

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

/**
* Constructor.
*
Expand Down Expand Up @@ -72,6 +77,8 @@ private Rhino(String accessKey,
float sensitivity,
float endpointDurationSec,
boolean requireEndpoint) throws RhinoException {
RhinoNative.setSdk(Rhino._sdk);

handle = RhinoNative.init(
accessKey,
modelPath,
Expand Down Expand Up @@ -121,6 +128,20 @@ public boolean process(short[] pcm) throws RhinoException {
return isFinalized;
}

/**
* Resets the internal state of Rhino. It should be called before the engine can be
* used to infer intent from a new stream of audio.
*
* @throws RhinoException if reset fails.
*/
public void reset() throws RhinoException {
if (handle == 0) {
throw new RhinoInvalidStateException("Attempted to call Rhino reset after delete.");
}

RhinoNative.reset(handle);
}

/**
* Gets inference result from Rhino. If the spoken command was understood, it includes the
* specific intent name that was inferred, and (if applicable) slot keys and specific slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,8 @@
package ai.picovoice.rhino;

import android.content.Context;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.os.Handler;
import android.os.Looper;
import android.os.Process;
import android.util.Log;

import java.util.concurrent.Callable;
import java.util.concurrent.Executors;

import ai.picovoice.android.voiceprocessor.VoiceProcessor;
import ai.picovoice.android.voiceprocessor.VoiceProcessorErrorListener;
import ai.picovoice.android.voiceprocessor.VoiceProcessorException;
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 RhinoNative {

static native String getVersion();

static native void setSdk(String sdk);

static native long init(
String accessKey,
String modelPath,
Expand All @@ -32,6 +34,8 @@ static native long init(

static native boolean process(long object, short[] pcm) throws RhinoException;

static native void reset(long object) throws RhinoException;

static native RhinoInference getInference(long object) throws RhinoException;

static native String getContextInfo(long object) throws RhinoException;
Expand Down
Loading

0 comments on commit b6cb26b

Please sign in to comment.