diff --git a/.github/workflows/android-demos.yml b/.github/workflows/android-demos.yml new file mode 100644 index 000000000..5cdfb11fd --- /dev/null +++ b/.github/workflows/android-demos.yml @@ -0,0 +1,35 @@ +name: Android Demos + +on: + workflow_dispatch: + push: + branches: [ master ] + paths: + - '.github/workflows/android-demos.yml' + - 'demo/android/**' + - '!demo/android/Activity/README.md' + pull_request: + branches: [ master, 'v[0-9]+.[0-9]+' ] + paths: + - '.github/workflows/android-demos.yml' + - 'demo/android/**' + - '!demo/android/Activity/README.md' + +jobs: + build-activity-demo: + runs-on: ubuntu-latest + defaults: + run: + working-directory: demo/android/Activity + + steps: + - uses: actions/checkout@v3 + + - name: set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build + run: ./gradlew assembleDebug \ No newline at end of file diff --git a/README.md b/README.md index ff1a7d755..8e01673c0 100644 --- a/README.md +++ b/README.md @@ -1170,7 +1170,9 @@ handle.delete() ### iOS + The Rhino iOS binding is available via [CocoaPods](https://cocoapods.org/pods/Rhino-iOS). To import it into your iOS project, add the following line to your Podfile and run `pod install`: + ```ruby pod 'Rhino-iOS' diff --git a/binding/ios/README.md b/binding/ios/README.md index 7702c9076..6ef810e4d 100644 --- a/binding/ios/README.md +++ b/binding/ios/README.md @@ -23,7 +23,9 @@ Rhino is: ## Installation -The Rhino iOS binding is available via [CocoaPods](https://cocoapods.org/pods/Rhino-iOS). To import it into your iOS project, add the following line to your Podfile and run `pod install`: + +The Rhino iOS binding is available via [CocoaPods](https://cocoapods.org/pods/Rhino-iOS). To import it into your iOS project, add the following line to your Podfile and run `pod install`: + ```ruby pod 'Rhino-iOS' @@ -59,7 +61,7 @@ let accessKey = "${ACCESS_KEY}" // Obtained from Picovoice Console (https://cons do { let rhinoManager = try RhinoManager( accessKey: accessKey, - contextPath: "/path/to/context/file.rhn", + contextPath: "/path/to/context/file.rhn", onInferenceCallback: inferenceCallback) } catch { } ``` @@ -77,11 +79,11 @@ let inferenceCallback: ((Inference) -> Void) = { inference in } ``` -You can override the default Rhino model file and/or the inference sensitivity. +You can override the default Rhino model file and/or the inference sensitivity. -Sensitivity is the parameter that enables trading miss rate for the false alarm rate. It is a floating-point number within [0, 1]. A higher sensitivity reduces the miss rate at the cost of increased false alarm rate. +Sensitivity is the parameter that enables trading miss rate for the false alarm rate. It is a floating-point number within [0, 1]. A higher sensitivity reduces the miss rate at the cost of increased false alarm rate. -The model file contains the parameters for the speech-to-intent engine. To change the language that Rhino understands, you'll pass in a different model file. +The model file contains the parameters for the speech-to-intent engine. To change the language that Rhino understands, you'll pass in a different model file. These optional parameters can be set like so: ```swift @@ -89,7 +91,7 @@ let accessKey = "${ACCESS_KEY}" // Obtained from Picovoice Console (https://cons do { let rhinoManager = try RhinoManager( accessKey: accessKey, - contextPath: "/path/to/context/file.rhn", + contextPath: "/path/to/context/file.rhn", modelPath: "/path/to/model/file.pv", sensitivity: 0.35, onInferenceCallback: inferenceCallback) @@ -97,7 +99,7 @@ do { ``` Once you have instantiated a RhinoManager, you can start audio capture and intent inference using the `.process()` function. -Audio capture stops and rhino resets once an inference result is returned via the inference callback. +Audio capture stops and rhino resets once an inference result is returned via the inference callback. ```swift do { diff --git a/demo/android/Activity/build.gradle b/demo/android/Activity/build.gradle index bdc4b5806..737e6c178 100644 --- a/demo/android/Activity/build.gradle +++ b/demo/android/Activity/build.gradle @@ -1,6 +1,5 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. ext { - defaultTargetSdkVersion = 31 + defaultTargetSdkVersion = 33 } buildscript { @@ -10,14 +9,16 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:7.4.2' } } allprojects { gradle.projectsEvaluated { - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:deprecation" + tasks.withType(JavaCompile).tap { + configureEach { + options.compilerArgs << "-Xlint:deprecation" + } } } @@ -27,6 +28,6 @@ allprojects { } } -task clean(type: Delete) { +tasks.register('clean', Delete) { delete rootProject.buildDir } diff --git a/demo/android/Activity/gradle/wrapper/gradle-wrapper.properties b/demo/android/Activity/gradle/wrapper/gradle-wrapper.properties index 0d6984602..3f5cd77a6 100644 --- a/demo/android/Activity/gradle/wrapper/gradle-wrapper.properties +++ b/demo/android/Activity/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip diff --git a/demo/android/Activity/rhino-activity-demo-app/build.gradle b/demo/android/Activity/rhino-activity-demo-app/build.gradle index 65af56694..baae43df2 100644 --- a/demo/android/Activity/rhino-activity-demo-app/build.gradle +++ b/demo/android/Activity/rhino-activity-demo-app/build.gradle @@ -3,7 +3,7 @@ import groovy.json.JsonSlurper apply plugin: 'com.android.application' android { - compileSdkVersion defaultTargetSdkVersion + compileSdk defaultTargetSdkVersion defaultConfig { applicationId "ai.picovoice.rhinodemo" @@ -73,6 +73,7 @@ android { lint { abortOnError false } + namespace 'ai.picovoice.rhinodemo' } dependencies { diff --git a/demo/android/Activity/rhino-activity-demo-app/src/main/AndroidManifest.xml b/demo/android/Activity/rhino-activity-demo-app/src/main/AndroidManifest.xml index e1d07d61f..d4af8b9a3 100644 --- a/demo/android/Activity/rhino-activity-demo-app/src/main/AndroidManifest.xml +++ b/demo/android/Activity/rhino-activity-demo-app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/demo/flutter/android/app/build.gradle b/demo/flutter/android/app/build.gradle index 34a391943..43ff30cb8 100644 --- a/demo/flutter/android/app/build.gradle +++ b/demo/flutter/android/app/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 33 + compileSdk 33 lintOptions { disable 'InvalidPackage' diff --git a/demo/flutter/android/build.gradle b/demo/flutter/android/build.gradle index bd04753b1..98811922b 100644 --- a/demo/flutter/android/build.gradle +++ b/demo/flutter/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' + classpath 'com.android.tools.build:gradle:7.4.2' } } @@ -24,6 +24,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties b/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties index 74f876f4f..b5618a594 100644 --- a/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties +++ b/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME \ No newline at end of file diff --git a/demo/flutter/pubspec.lock b/demo/flutter/pubspec.lock index 417738591..744e860d6 100644 --- a/demo/flutter/pubspec.lock +++ b/demo/flutter/pubspec.lock @@ -1,83 +1,70 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.11" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.16.0" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "1.18.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + url: "https://pub.dev" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -97,7 +84,8 @@ packages: dependency: transitive description: name: flutter_voice_processor - url: "https://pub.dartlang.org" + sha256: fb511a2f0ca9540c4b7c6715515389d27b5bbd332138ab3a300078fb243a0caf + url: "https://pub.dev" source: hosted version: "1.1.0" fuchsia_remote_debug_protocol: @@ -114,105 +102,120 @@ packages: dependency: "direct dev" description: name: lints - url: "https://pub.dartlang.org" + sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + url: "https://pub.dev" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.10.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.8.3" path_provider: dependency: transitive description: name: path_provider - url: "https://pub.dartlang.org" + sha256: c7edf82217d4b2952b2129a61d3ad60f1075b9299e629e149a8d2e39c2e6aad4 + url: "https://pub.dev" source: hosted version: "2.0.14" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + sha256: "019f18c9c10ae370b08dce1f3e3b73bc9f58e7f087bb5e921f06529438ac0ae7" + url: "https://pub.dev" source: hosted version: "2.0.24" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - url: "https://pub.dartlang.org" + sha256: "818b2dc38b0f178e0ea3f7cf3b28146faab11375985d815942a68eee11c2d0f7" + url: "https://pub.dev" source: hosted version: "2.2.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1" + url: "https://pub.dev" source: hosted version: "2.1.10" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + url: "https://pub.dev" source: hosted version: "2.0.6" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: f53720498d5a543f9607db4b0e997c4b5438884de25b0f73098cc2671a51b130 + url: "https://pub.dev" source: hosted version: "2.1.5" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" source: hosted version: "2.1.4" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" rhino_flutter: dependency: "direct main" description: name: rhino_flutter - url: "https://pub.dartlang.org" + sha256: "3283c845ff2fa4b1822b064854b8efe51ed23db94ddc14a2d9ccb5edd1b65a6d" + url: "https://pub.dev" source: hosted version: "3.0.1" sky_engine: @@ -224,93 +227,106 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" sync_http: dependency: transitive description: name: sync_http - url: "https://pub.dartlang.org" + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.9" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.6.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + url: "https://pub.dev" source: hosted - version: "8.2.2" + version: "11.10.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" webdriver: dependency: transitive description: name: webdriver - url: "https://pub.dartlang.org" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 + url: "https://pub.dev" source: hosted version: "3.1.3" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + url: "https://pub.dev" source: hosted version: "1.0.0" sdks: - dart: ">=2.17.0 <3.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.0.0" diff --git a/demo/react-native/android/build.gradle b/demo/react-native/android/build.gradle index 3ff5bd881..422af6cfd 100644 --- a/demo/react-native/android/build.gradle +++ b/demo/react-native/android/build.gradle @@ -1,20 +1,16 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { ext { - buildToolsVersion = "29.0.2" + buildToolsVersion = "30.0.3" minSdkVersion = 21 - compileSdkVersion = 29 - targetSdkVersion = 30 + compileSdkVersion = 33 + targetSdkVersion = 33 } repositories { google() jcenter() } dependencies { - classpath("com.android.tools.build:gradle:4.1.3") - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath 'com.android.tools.build:gradle:7.4.2' } } diff --git a/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties b/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties index 4bae82d66..87468bb1a 100644 --- a/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties +++ b/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Nov 18 15:37:58 PST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/demo/react-native/android/rhino-rn-demo-app/build.gradle b/demo/react-native/android/rhino-rn-demo-app/build.gradle index 114af9098..44c2ceae4 100644 --- a/demo/react-native/android/rhino-rn-demo-app/build.gradle +++ b/demo/react-native/android/rhino-rn-demo-app/build.gradle @@ -121,7 +121,7 @@ def jscFlavor = 'org.webkit:android-jsc:+' def enableHermes = project.ext.react.get("enableHermes", false); android { - compileSdkVersion rootProject.ext.compileSdkVersion + compileSdk rootProject.ext.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -209,11 +209,4 @@ dependencies { } } -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile - into 'libs' -} - apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/demo/react-native/android/rhino-rn-demo-app/src/main/AndroidManifest.xml b/demo/react-native/android/rhino-rn-demo-app/src/main/AndroidManifest.xml index 95e8684e9..b0eb838ab 100644 --- a/demo/react-native/android/rhino-rn-demo-app/src/main/AndroidManifest.xml +++ b/demo/react-native/android/rhino-rn-demo-app/src/main/AndroidManifest.xml @@ -16,7 +16,8 @@ android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" + android:exported="true">