From ac05fb88402d94afe83509fa69d8ece77d93bdc8 Mon Sep 17 00:00:00 2001 From: Ian Lavery Date: Thu, 10 Aug 2023 10:45:16 -0700 Subject: [PATCH] Flutter vp updates (#642) --- demo/flutter-clock/ios/Podfile.lock | 29 +-- demo/flutter-clock/pubspec.lock | 180 ++++++++----------- demo/flutter-clock/pubspec.yaml | 2 +- demo/flutter/ios/Podfile.lock | 36 ++-- demo/flutter/pubspec.lock | 236 +++++++++++-------------- demo/flutter/pubspec.yaml | 2 +- sdk/flutter/CHANGELOG.md | 5 +- sdk/flutter/lib/picovoice_manager.dart | 105 ++++++----- sdk/flutter/pubspec.lock | 6 +- sdk/flutter/pubspec.yaml | 8 +- 10 files changed, 276 insertions(+), 333 deletions(-) diff --git a/demo/flutter-clock/ios/Podfile.lock b/demo/flutter-clock/ios/Podfile.lock index 06c8bb7f8..527ff0375 100644 --- a/demo/flutter-clock/ios/Podfile.lock +++ b/demo/flutter-clock/ios/Podfile.lock @@ -2,22 +2,23 @@ PODS: - Flutter (1.0.0) - flutter_ringtone_player (0.0.1): - Flutter - - flutter_voice_processor (1.0.6): + - flutter_voice_processor (1.1.0): - Flutter + - ios-voice-processor (~> 1.1.0) - fluttertoast (0.0.2): - Flutter - Toast - - ios-voice-processor (1.0.3) + - ios-voice-processor (1.1.0) - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - Porcupine-iOS (2.2.0): - - ios-voice-processor (~> 1.0.2) + - Porcupine-iOS (2.2.1): + - ios-voice-processor (~> 1.1.0) - porcupine_flutter (2.2.0): - Flutter - Porcupine-iOS (~> 2.2.0) - - Rhino-iOS (2.2.0): - - ios-voice-processor (~> 1.0.2) + - Rhino-iOS (2.2.2): + - ios-voice-processor (~> 1.1.0) - rhino_flutter (2.2.0): - Flutter - Rhino-iOS (~> 2.2.0) @@ -28,7 +29,7 @@ DEPENDENCIES: - flutter_ringtone_player (from `.symlinks/plugins/flutter_ringtone_player/ios`) - flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) - porcupine_flutter (from `.symlinks/plugins/porcupine_flutter/ios`) - rhino_flutter (from `.symlinks/plugins/rhino_flutter/ios`) @@ -49,22 +50,22 @@ EXTERNAL SOURCES: fluttertoast: :path: ".symlinks/plugins/fluttertoast/ios" path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/darwin" + :path: ".symlinks/plugins/path_provider_foundation/ios" porcupine_flutter: :path: ".symlinks/plugins/porcupine_flutter/ios" rhino_flutter: :path: ".symlinks/plugins/rhino_flutter/ios" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a flutter_ringtone_player: 15eba85187230b87b2512f0e1b92225618bc03e7 - flutter_voice_processor: afb59b604d99397a1ccf15c935ac8f2c2327f09f + flutter_voice_processor: 53afbf59ad3feb82f4a379fea9ed8dc98495210f fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c - ios-voice-processor: 65b25a8db69ea25ffba0eeef37bae71a982f34cc - path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 - Porcupine-iOS: 34f7b77fbd5f999eb9c4daa94acbb6c90c08ad1e + ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 + path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9 + Porcupine-iOS: df8e4a63d787b6c16bd5f988fd0f2c29a249a4bd porcupine_flutter: bb07c08c1a5c504732ea0b1eb7cb3be4916858be - Rhino-iOS: 5f6c2edc809a913f7559da93fc92c0e66c7bf711 + Rhino-iOS: 0fad86b28d35f67ccb6bd0a2efbbcc0d88b05124 rhino_flutter: 4c3b4bbe00206617c38ea6f7c2f17d23b2879e90 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 diff --git a/demo/flutter-clock/pubspec.lock b/demo/flutter-clock/pubspec.lock index fcea175a1..5de2f7a16 100644 --- a/demo/flutter-clock/pubspec.lock +++ b/demo/flutter-clock/pubspec.lock @@ -5,64 +5,63 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.11.0" + version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.17.1" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.0" ffi: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "6.1.4" flutter: @@ -74,8 +73,7 @@ packages: dependency: "direct main" description: name: flutter_ringtone_player - sha256: "0b036416fda0654da52221989bd1a8ccd2876cea57f61ecc3a4fc272bd738c67" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" flutter_test: @@ -87,10 +85,9 @@ packages: dependency: transitive description: name: flutter_voice_processor - sha256: "198e7b40fd22f10e77ea882394636f11201f36ada8a8477df915a168f17dd932" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.10" + version: "1.1.0" flutter_web_plugins: dependency: transitive description: flutter @@ -100,162 +97,142 @@ packages: dependency: "direct main" description: name: fluttertoast - sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "8.2.2" intl: dependency: "direct main" description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "0.17.0" js: dependency: transitive description: name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.6.7" + version: "0.6.4" lints: dependency: "direct dev" description: name: lints - sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.12.15" + version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.1.4" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.9.1" + version: "1.7.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.8.3" + version: "1.8.1" path_provider: dependency: "direct main" description: name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.15" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.27" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.3" + version: "2.2.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.11" + version: "2.1.10" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.0.6" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.7" + version: "2.1.6" picovoice_flutter: dependency: "direct main" description: name: picovoice_flutter - sha256: "0eb7ce1fd65449f6e63c2dd85701e68398fefc588364a00898968dfb17ba085e" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.2" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "2.1.4" porcupine_flutter: dependency: transitive description: name: porcupine_flutter - sha256: "3602914be5811332106525c9457236724224734873ea302e72eb935385931f2c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.2.1" process: dependency: transitive description: name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.2.4" rhino_flutter: dependency: transitive description: name: rhino_flutter - sha256: "25f06f0bcbe76c5de0fe916896c8d4dec1ddb853c73c3d39399ccc91648141bb" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.2" sky_engine: dependency: transitive description: flutter @@ -265,74 +242,65 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.9.1" + version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.5.1" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.2" win32: dependency: transitive description: name: win32 - sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "5.0.5" + version: "4.1.4" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=3.3.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/demo/flutter-clock/pubspec.yaml b/demo/flutter-clock/pubspec.yaml index 0a4807354..eb2d6445a 100644 --- a/demo/flutter-clock/pubspec.yaml +++ b/demo/flutter-clock/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: sdk: flutter intl: ^0.17.0 path_provider: ^2.0.9 - picovoice_flutter: ^2.2.0 + picovoice_flutter: ^2.2.2 flutter_ringtone_player: ^3.0.0 fluttertoast: ^8.0.9 diff --git a/demo/flutter/ios/Podfile.lock b/demo/flutter/ios/Podfile.lock index c3ef5993a..72d4afa7c 100644 --- a/demo/flutter/ios/Podfile.lock +++ b/demo/flutter/ios/Podfile.lock @@ -1,19 +1,21 @@ PODS: - Flutter (1.0.0) - - flutter_voice_processor (1.0.6): + - flutter_voice_processor (1.1.0): - Flutter + - ios-voice-processor (~> 1.1.0) - integration_test (0.0.1): - Flutter - - ios-voice-processor (1.0.3) - - path_provider_ios (0.0.1): + - ios-voice-processor (1.1.0) + - path_provider_foundation (0.0.1): - Flutter - - Porcupine-iOS (2.2.0): - - ios-voice-processor (~> 1.0.2) + - FlutterMacOS + - Porcupine-iOS (2.2.1): + - ios-voice-processor (~> 1.1.0) - porcupine_flutter (2.2.0): - Flutter - Porcupine-iOS (~> 2.2.0) - - Rhino-iOS (2.2.0): - - ios-voice-processor (~> 1.0.2) + - Rhino-iOS (2.2.2): + - ios-voice-processor (~> 1.1.0) - rhino_flutter (2.2.0): - Flutter - Rhino-iOS (~> 2.2.0) @@ -22,7 +24,7 @@ DEPENDENCIES: - Flutter (from `Flutter`) - flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`) - integration_test (from `.symlinks/plugins/integration_test/ios`) - - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) - porcupine_flutter (from `.symlinks/plugins/porcupine_flutter/ios`) - rhino_flutter (from `.symlinks/plugins/rhino_flutter/ios`) @@ -39,22 +41,22 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_voice_processor/ios" integration_test: :path: ".symlinks/plugins/integration_test/ios" - path_provider_ios: - :path: ".symlinks/plugins/path_provider_ios/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/ios" porcupine_flutter: :path: ".symlinks/plugins/porcupine_flutter/ios" rhino_flutter: :path: ".symlinks/plugins/rhino_flutter/ios" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - flutter_voice_processor: afb59b604d99397a1ccf15c935ac8f2c2327f09f - integration_test: 13825b8a9334a850581300559b8839134b124670 - ios-voice-processor: 65b25a8db69ea25ffba0eeef37bae71a982f34cc - path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 - Porcupine-iOS: 34f7b77fbd5f999eb9c4daa94acbb6c90c08ad1e + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + flutter_voice_processor: 53afbf59ad3feb82f4a379fea9ed8dc98495210f + integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5 + ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 + path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9 + Porcupine-iOS: df8e4a63d787b6c16bd5f988fd0f2c29a249a4bd porcupine_flutter: bb07c08c1a5c504732ea0b1eb7cb3be4916858be - Rhino-iOS: 5f6c2edc809a913f7559da93fc92c0e66c7bf711 + Rhino-iOS: 0fad86b28d35f67ccb6bd0a2efbbcc0d88b05124 rhino_flutter: 4c3b4bbe00206617c38ea6f7c2f17d23b2879e90 PODFILE CHECKSUM: b95e0c370474df3a1db278b722738a6230f01f51 diff --git a/demo/flutter/pubspec.lock b/demo/flutter/pubspec.lock index 7cd4a18b2..30baddbcb 100644 --- a/demo/flutter/pubspec.lock +++ b/demo/flutter/pubspec.lock @@ -1,70 +1,83 @@ # 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 - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.11.0" + version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.17.1" + version: "1.16.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.0" ffi: dependency: transitive description: name: ffi - sha256: "35d0f481d939de0d640b3db9a7aa36a52cd22054a798a73b4f50bdad5ce12678" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "2.0.2" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "6.1.4" + version: "6.1.2" flutter: dependency: "direct main" description: flutter @@ -84,10 +97,9 @@ packages: dependency: transitive description: name: flutter_voice_processor - sha256: "198e7b40fd22f10e77ea882394636f11201f36ada8a8477df915a168f17dd932" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.10" + version: "1.1.0" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -98,158 +110,125 @@ packages: description: flutter source: sdk version: "0.0.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" lints: dependency: "direct dev" description: name: lints - sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.12.15" + version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.1.4" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.9.1" + version: "1.7.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.8.3" + version: "1.8.1" path_provider: dependency: "direct main" description: name: path_provider - sha256: e92dee4d38a9044605cb3fb253e9b46eb9375dfcad4515d0379b44ac90797568 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.15" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "8b759fb6c74955931e87f550cc9e890b0cccb7ef8e710943973efeaa9695c54d" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.12" - path_provider_ios: + version: "2.0.27" + path_provider_foundation: dependency: transitive description: - name: path_provider_ios - sha256: "943b76e54056386432cdc2731cb303e2f580346b61a1fc73819721767be72309" - url: "https://pub.dev" + name: path_provider_foundation + url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.2.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: "1e109f4df28bd95eab71e323008b53d19c4d633bc1ab05b577518773474e9621" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - sha256: "0adeb313e1f2c3fc52baeeee59b0fe9c2d1f7da56fd96a9234e1702ec653a453" - url: "https://pub.dev" - source: hosted - version: "2.0.5" + version: "2.1.10" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "3dc0d51b07f85fec3746d9f4e8d31c73bb173cafa2e763f03f8df2e8d1878882" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.6" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: "366ad4e3541ea707f859e7148d4d5aba67d589d7936cee04a05c464a277eeb27" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.6" picovoice_flutter: dependency: "direct main" description: name: picovoice_flutter - sha256: "0eb7ce1fd65449f6e63c2dd85701e68398fefc588364a00898968dfb17ba085e" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.2" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.4" porcupine_flutter: dependency: transitive description: name: porcupine_flutter - sha256: "3602914be5811332106525c9457236724224734873ea302e72eb935385931f2c" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.2.1" process: dependency: transitive description: name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted version: "4.2.4" rhino_flutter: dependency: transitive description: name: rhino_flutter - sha256: "25f06f0bcbe76c5de0fe916896c8d4dec1ddb853c73c3d39399ccc91648141bb" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.2" sky_engine: dependency: transitive description: flutter @@ -259,98 +238,93 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.9.1" + version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.1.0" sync_http: dependency: transitive description: name: sync_http - sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.3.1" + version: "0.3.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.dev" + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.9" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" source: hosted - version: "0.5.1" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service - sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "11.3.0" + version: "8.2.2" webdriver: dependency: transitive description: name: webdriver - sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.0.0" win32: dependency: transitive description: name: win32 - sha256: "4b0c8f8459cf2b2b524d81dbd678de26f0f1a7b1fd5656c05425b60ec3f383fd" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "4.1.4" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "060b6e1c891d956f72b5ac9463466c37cce3fa962a921532fc001e86fe93438e" - url: "https://pub.dev" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+1" + version: "1.0.0" sdks: - dart: ">=3.0.0-0 <4.0.0" - flutter: ">=2.8.1" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/demo/flutter/pubspec.yaml b/demo/flutter/pubspec.yaml index 7a5c5fb42..494831647 100644 --- a/demo/flutter/pubspec.yaml +++ b/demo/flutter/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: sdk: flutter path_provider: ^2.0.9 - picovoice_flutter: ^2.2.1 + picovoice_flutter: ^2.2.2 dev_dependencies: integration_test: diff --git a/sdk/flutter/CHANGELOG.md b/sdk/flutter/CHANGELOG.md index a2176a85a..454c426fe 100644 --- a/sdk/flutter/CHANGELOG.md +++ b/sdk/flutter/CHANGELOG.md @@ -33,4 +33,7 @@ * Additional language support added (ar, hi, nl, pl, ru, sv, vn, zh) ## [2.2.1] - 2023-06-02 -* Expose context info through PicovoiceManager \ No newline at end of file +* Expose context info through PicovoiceManager + +## [2.2.2] - 2023-08-09 +* Update flutter-voice-processor \ No newline at end of file diff --git a/sdk/flutter/lib/picovoice_manager.dart b/sdk/flutter/lib/picovoice_manager.dart index d102d55ea..d45a0de9f 100644 --- a/sdk/flutter/lib/picovoice_manager.dart +++ b/sdk/flutter/lib/picovoice_manager.dart @@ -18,13 +18,13 @@ typedef ProcessErrorCallback = Function(PicovoiceException error); class PicovoiceManager { Picovoice? _picovoice; - VoiceProcessor? _voiceProcessor; - RemoveListener? _removeVoiceProcessorListener; - RemoveListener? _removeErrorListener; - final ProcessErrorCallback? _processErrorCallback; + final VoiceProcessor? _voiceProcessor; final String _accessKey; + late VoiceProcessorFrameListener _frameListener; + late VoiceProcessorErrorListener _errorListener; + final String? _porcupineModelPath; final String _keywordPath; final double _porcupineSensitivity; @@ -36,6 +36,7 @@ class PicovoiceManager { final InferenceCallback _inferenceCallback; final double _endpointDurationSec; final bool _requireEndpoint; + final ProcessErrorCallback? _processErrorCallback; /// Gets the source of the Rhino context in YAML format. Shows the list of intents, /// which expressions map to those intents, as well as slots and their possible values. @@ -124,11 +125,31 @@ class PicovoiceManager { this._rhinoModelPath, this._endpointDurationSec, this._requireEndpoint, - this._processErrorCallback); + this._processErrorCallback) + : _voiceProcessor = VoiceProcessor.instance { + _frameListener = (List frame) async { + if (_picovoice == null) { + return; + } + + try { + _picovoice?.process(frame); + } on PicovoiceException catch (error) { + _processErrorCallback == null + ? print(error.message) + : _processErrorCallback!(error); + } + }; + + _errorListener = (VoiceProcessorException error) { + _processErrorCallback == null + ? print(error.message) + : _processErrorCallback!(PicovoiceException(error.message)); + }; + } /// Opens audio input stream and sends audio frames to Picovoice. - /// Throws a `PvAudioException` if there was a problem starting the audio engine. - /// Throws a `PvError` if an instance of Picovoice could not be created. + /// Throws a `PicovoiceException` if an instance of Picovoice could not be created. Future start() async { if (_picovoice != null) { return; @@ -143,65 +164,39 @@ class PicovoiceManager { endpointDurationSec: _endpointDurationSec, requireEndpoint: _requireEndpoint); - _voiceProcessor ??= VoiceProcessor.getVoiceProcessor( - _picovoice!.frameLength!, _picovoice!.sampleRate!); - - if (_voiceProcessor == null) { - throw PicovoiceRuntimeException("flutter_voice_processor not available."); - } - _removeVoiceProcessorListener = - _voiceProcessor!.addListener((buffer) async { - // cast from dynamic to int array - List picovoiceFrame; - try { - picovoiceFrame = (buffer as List).cast(); - } on Error { - PicovoiceException castError = PicovoiceException( - "flutter_voice_processor sent an unexpected data type."); - _processErrorCallback == null - ? print(castError.message) - : _processErrorCallback!(castError); - return; - } - - // process frame with Picovoice - try { - _picovoice?.process(picovoiceFrame); - } on PicovoiceException catch (error) { - _processErrorCallback == null - ? print(error.message) - : _processErrorCallback!(error); - } - }); - - _removeErrorListener = _voiceProcessor!.addErrorListener((errorMsg) { - PicovoiceException nativeError = PicovoiceException(errorMsg as String); - _processErrorCallback == null - ? print(nativeError.message) - : _processErrorCallback!(nativeError); - }); - if (await _voiceProcessor?.hasRecordAudioPermission() ?? false) { + _voiceProcessor?.addFrameListener(_frameListener); + _voiceProcessor?.addErrorListener(_errorListener); try { - // create picovoice - await _voiceProcessor!.start(); - } on PlatformException { + await _voiceProcessor?.start( + _picovoice!.frameLength!, _picovoice!.sampleRate!); + } on PlatformException catch (e) { throw PicovoiceRuntimeException( - "Audio engine failed to start. Hardware may not be supported."); + "Failed to start audio recording: ${e.message}"); } } else { - throw PicovoiceInvalidStateException( + throw PicovoiceRuntimeException( "User did not give permission to record audio."); } } - /// Closes audio stream and stops Picovoice processing + /// Closes audio stream and stops Picovoice processing. + /// Throws a `PorcupineException` if there was a problem stopping audio recording. Future stop() async { - if (_voiceProcessor?.isRecording ?? false) { - await _voiceProcessor!.stop(); + if (_picovoice == null) { + return; + } + _voiceProcessor?.removeErrorListener(_errorListener); + _voiceProcessor?.removeFrameListener(_frameListener); + + if (_voiceProcessor?.numFrameListeners == 0) { + try { + await _voiceProcessor?.stop(); + } on PlatformException catch (e) { + throw PicovoiceRuntimeException( + "Failed to stop audio recording: ${e.message}"); + } } - _removeVoiceProcessorListener?.call(); - _removeErrorListener?.call(); _picovoice?.delete(); _picovoice = null; diff --git a/sdk/flutter/pubspec.lock b/sdk/flutter/pubspec.lock index b14c98ffd..b777c66e4 100644 --- a/sdk/flutter/pubspec.lock +++ b/sdk/flutter/pubspec.lock @@ -80,7 +80,7 @@ packages: name: flutter_voice_processor url: "https://pub.dartlang.org" source: hosted - version: "1.0.10" + version: "1.1.0" lints: dependency: "direct dev" description: @@ -185,7 +185,7 @@ packages: name: porcupine_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.2.1" process: dependency: transitive description: @@ -199,7 +199,7 @@ packages: name: rhino_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.2" sky_engine: dependency: transitive description: flutter diff --git a/sdk/flutter/pubspec.yaml b/sdk/flutter/pubspec.yaml index fa60e70b3..51e3fadb2 100644 --- a/sdk/flutter/pubspec.yaml +++ b/sdk/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: picovoice_flutter description: A Flutter package for Picovoice's end-to-end voice platform. -version: 2.2.1 +version: 2.2.2 homepage: https://picovoice.ai/ repository: https://github.com/Picovoice/picovoice/ documentation: https://picovoice.ai/docs/picovoice/ @@ -12,9 +12,9 @@ environment: dependencies: flutter: sdk: flutter - flutter_voice_processor: ^1.0.10 - porcupine_flutter: ^2.2.0 - rhino_flutter: ^2.2.1 + flutter_voice_processor: ^1.1.0 + porcupine_flutter: ^2.2.1 + rhino_flutter: ^2.2.2 dev_dependencies: flutter_test: