csdcorp / speech_to_text Goto Github PK
View Code? Open in Web Editor NEWA Flutter plugin that exposes device specific text to speech recognition capability.
License: BSD 3-Clause "New" or "Revised" License
A Flutter plugin that exposes device specific text to speech recognition capability.
License: BSD 3-Clause "New" or "Revised" License
I observe the following behavior, if I am using lib for the first time and do not apply the permission, I cannot change the initialize method as it loops in the following error.
Only one initialize at a time
The way I found to request permission more than once if the user did not grant permission was to remove the following code snippet.
if (null! = activeResult) {
result.error (SpeechToTextErrors.multipleRequests.name,
"Only one initialize at a time", null)
return
}
I think a lot of other people must be going through the same problem as mine.
Hello everyone,
I Want to realize speech to text in one file that I save, is it posible?
If no, Can I save the audio and recognize in the same time?
If some of this are posible, can someone send me a example?
Thanks.
Best Regards.
thanks
https://developer.android.com/reference/android/speech/SpeechRecognizer
ERROR_NETWORK_TIMEOUT
Network operation timed out.
ERROR_SPEECH_TIMEOUT
No speech input
why ?
notifyError {"errorMsg":"error_timeout","permanent":true}
I followed the tutorial and installed 0.8.0. The emulator app keeps throwing unavailable.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:speech_to_text/speech_to_text.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool _hasSpeech = false;
String lastWords = "";
String lastError = "";
String lastStatus = "";
final SpeechToText speech = SpeechToText();
@override
void initState() {
super.initState();
initSpeechState();
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
if (!mounted) return;
setState(() {
_hasSpeech = hasSpeech;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Speech to Text Example'),
),
body: _hasSpeech
? Column(children: [
Expanded(
child: Center(
child: Text('Speech recognition available'),
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Text('Start'),
onPressed: startListening,
),
FlatButton(
child: Text('Stop'),
onPressed: stopListening,
),
FlatButton(
child: Text('Cancel'),
onPressed: cancelListening,
),
],
),
),
Expanded(
child: Column(
children: <Widget>[
Center(
child: Text('Recognized Words'),
),
Center(
child: Text(lastWords),
),
],
),
),
Expanded(
child: Column(
children: <Widget>[
Center(
child: Text('Error'),
),
Center(
child: Text(lastError),
),
],
),
),
Expanded(
child: Center(
child: speech.isListening
? Text("I'm listening...")
: Text('Not listening'),
),
),
])
: Center(
child: Text('Speech recognition unavailable',
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold))),
),
);
}
void startListening() {
lastWords = "";
lastError = "";
speech.listen(onResult: resultListener);
setState(() {});
}
void stopListening() {
speech.stop();
setState(() {});
}
void cancelListening() {
speech.cancel();
setState(() {});
}
void resultListener(SpeechRecognitionResult result) {
setState(() {
lastWords = "${result.recognizedWords} - ${result.finalResult}";
});
}
void errorListener(SpeechRecognitionError error) {
setState(() {
lastError = "${error.errorMsg} - ${error.permanent}";
});
}
void statusListener(String status) {
setState(() {
lastStatus = "$status";
});
}
}
v1.12.13+hotfix.8
I want to build an app, where you speak a word and flutter_tts speaks the data that was found to the search term in the database. The problem what I found out is, after the speech to text was used once flutter_tts do not speaks anymore:/
But this issue only comes to me on the real device (iPhones), in the ios Simulator everything is working fine. Do you have an idea, why that happens?
You can reproduce that issue if you add to your example app
FloatingActionButton(onPressed: () {
FlutterTts flutterTts = new FlutterTts();
flutterTts.setLanguage("en-US");
flutterTts.speak(lastWords);
}),
this snipped of code.
I really can't understand why it is working on the Simulator but not on the real device (ios)
I'm writing an app that requires Japanese speech-to-text, but every speech to text lib (only 2 of them, this one included) doesn't seem to have Japanese
When Running my project , i get this error :
FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
The following dependencies do not satisfy the required version:
project ':speech_to_text' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
following log is displayed
Building br.com.sankhya.biaAssistantFlutter for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: HV5V7KBQHK
Running pod install... 1,9s
Running Xcode build...
Xcode build done. 15,2s
Failed to build iOS app
Error output from Xcode build:
↳
2019-12-27 13:04:04.065 xcodebuild[21809:175441] DTDeviceKit: deviceType from 37ad1425578933ae32b2a67eadc4eaa8f8096cb8 was NULL
** BUILD FAILED **
Xcode's output:
↳
/Users/ellenguissoni/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.7.0/ios/Classes/SpeechToTextPlugin.m:6:4: warning: 'SwiftSpeechToTextPlugin' is only available on iOS 10.0 or newer [-Wunguarded-availability]
[SwiftSpeechToTextPlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/ellenguissoni/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.7.0/ios/Classes/SpeechToTextPlugin.m:2:
/Users/ellenguissoni/Desktop/sankhya/bia-assistant-flutter/build/ios/Release-iphoneos/speech_to_text/speech_to_text.framework/Headers/speech_to_text-Swift.h:456:12: note: 'SwiftSpeechToTextPlugin' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 8.0.0
@interface SwiftSpeechToTextPlugin : NSObject <FlutterPlugin>
^
/Users/ellenguissoni/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.7.0/ios/Classes/SpeechToTextPlugin.m:6:4: note: enclose 'SwiftSpeechToTextPlugin' in an @available check to silence this warning
[SwiftSpeechToTextPlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Users/ellenguissoni/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.7.0/ios/Classes/SpeechToTextPlugin.m:6:4: warning: 'SwiftSpeechToTextPlugin' is only available on iOS 10.0 or newer [-Wunguarded-availability]
[SwiftSpeechToTextPlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/ellenguissoni/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.7.0/ios/Classes/SpeechToTextPlugin.m:2:
/Users/ellenguissoni/Desktop/sankhya/bia-assistant-flutter/build/ios/Release-iphoneos/speech_to_text/speech_to_text.framework/Headers/speech_to_text-Swift.h:211:12: note: 'SwiftSpeechToTextPlugin' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 8.0.0
@interface SwiftSpeechToTextPlugin : NSObject <FlutterPlugin>
^
/Users/ellenguissoni/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.7.0/ios/Classes/SpeechToTextPlugin.m:6:4: note: enclose 'SwiftSpeechToTextPlugin' in an @available check to silence this warning
[SwiftSpeechToTextPlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Building AOT snapshot in release mode (ios-release)...
Compiler message:
Error: SDK summary not found: ../../flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/platform_strong.dill.
Error: Error when reading '../../flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/platform_strong.dill': No such file or directory
Error: Error when reading '../../flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/platform_strong.dill': No such file or directory
Unhandled exception:
Crash when compiling package:bia_assistant_flutter/main.dart,
at character offset null:
Bad state: Empty input given.
#0 BinaryBuilder._checkEmptyInput (package:kernel/binary/ast_from_binary.dart:457:29)
#1 BinaryBuilder.readComponent.<anonymous closure> (package:kernel/binary/ast_from_binary.dart:474:7)
#2 Timeline.timeSync (dart:developer/timeline.dart:163:22)
#3 BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:472:21)
#4 ProcessedOptions.loadComponent (package:front_end/src/base/processed_options.dart:410:10)
#5 ProcessedOptions.loadLinkDependencies.<anonymous closure> (package:front_end/src/base/processed_options.dart:394:35)
#6 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:29)
#7 ListIterable.toList (dart:_internal/iterable.dart:221:19)
#8 ProcessedOptions.loadLinkDependencies (package:front_end/src/base/processed_options.dart:394:67)
<asynchronous suspension>
#9 generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:115:48)
<asynchronous suspension>
#10 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#11 generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:70:10)
#12 kernelForProgramInternal.<anonymous closure> (package:front_end/src/api_prototype/kernel_generator.dart:61:35)
#13 CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#14 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#15 new Future.sync (dart:async/future.dart:224:31)
#16 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#17 _rootRun (dart:async/zone.dart:1126:13)
#18 _CustomZone.run (dart:async/zone.dart:1023:19)
#19 _runZoned (dart:async/zone.dart:1518:10)
#20 runZoned (dart:async/zone.dart:1465:12)
#21 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#22 CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#23 kernelForProgramInternal (package:front_end/src/api_prototype/kernel_generator.dart:60:32)
#24 kernelForProgram (package:front_end/src/api_prototype/kernel_generator.dart:52:17)
#25 compileToKernel (package:vm/kernel_front_end.dart:320:41)
#26 FrontendCompiler.compile.<anonymous closure> (package:frontend_server/frontend_server.dart:446:54)
#27 new Future.<anonymous closure> (dart:async/future.dart:176:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
#36 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
#37 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
#0 BinaryBuilder._checkEmptyInput (package:kernel/binary/ast_from_binary.dart:457:29)
#1 BinaryBuilder.readComponent.<anonymous closure> (package:kernel/binary/ast_from_binary.dart:474:7)
#2 Timeline.timeSync (dart:developer/timeline.dart:163:22)
#3 BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:472:21)
#4 ProcessedOptions.loadComponent (package:front_end/src/base/processed_options.dart:410:10)
#5 ProcessedOptions.loadLinkDependencies.<anonymous closure> (package:front_end/src/base/processed_options.dart:394:35)
#6 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:29)
#7 ListIterable.toList (dart:_internal/iterable.dart:221:19)
#8 ProcessedOptions.loadLinkDependencies (package:front_end/src/base/processed_options.dart:394:67)
<asynchronous suspension>
#9 generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:115:48)
<asynchronous suspension>
#10 withCrashReporting (package:front_end/src/fasta/crash.dart:122:24)
#11 generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:70:10)
#12 kernelForProgramInternal.<anonymous closure> (package:front_end/src/api_prototype/kernel_generator.dart:61:35)
#13 CompilerContext.runWithOptions.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:135:20)
<asynchronous suspension>
#14 CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:46)
#15 new Future.sync (dart:async/future.dart:224:31)
#16 CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:123:19)
#17 _rootRun (dart:async/zone.dart:1126:13)
#18 _CustomZone.run (dart:async/zone.dart:1023:19)
#19 _runZoned (dart:async/zone.dart:1518:10)
#20 runZoned (dart:async/zone.dart:1465:12)
#21 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:122:12)
#22 CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:133:10)
#23 kernelForProgramInternal (package:front_end/src/api_prototype/kernel_generator.dart:60:32)
#24 kernelForProgram (package:front_end/src/api_prototype/kernel_generator.dart:52:17)
#25 compileToKernel (package:vm/kernel_front_end.dart:320:41)
#26 FrontendCompiler.compile.<anonymous closure> (package:frontend_server/frontend_server.dart:446:54)
#27 new Future.<anonymous closure> (dart:async/future.dart:176:37)
#28 _rootRun (dart:async/zone.dart:1122:38)
#29 _CustomZone.run (dart:async/zone.dart:1023:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#31 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#32 _rootRun (dart:async/zone.dart:1126:13)
#33 _CustomZone.run (dart:async/zone.dart:1023:19)
#34 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#35 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
#36 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
#37 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
#38 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
Compiler terminated unexpectedly.
Failed to build /Users/ellenguissoni/Desktop/sankhya/bia-assistant-flutter.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning build
note: Constructing build description
Encountered error while building for device.
Process finished with exit code 1
add hasPermission support.
I couldn't access a recognition function from: onRmsChanged where I need to change the values to apply an animation to my screen, any solution for me to get this data?
suddenly my code give me that error message on version 0.7
& `0.7.1'
SpeechRecognitionError msg: error_audio_error, permanent: true
I have test your example code also give me same issue
I don't know what message mean , please let me know what is meaning ?
Phone mi note 4
OS : Android 7
Other app can able to use speech to text and voice typing
Can't change the error & status handler try to a new speech instance when I had another speech instance.
Try to fix it by the bottom code, and it's working but not sure it's right way.
Future<bool> initialize( {SpeechErrorListener onError, SpeechStatusListener onStatus}) async { if (_initWorked) { errorListener = onError; statusListener = onStatus; channel.setMethodCallHandler(_handleCallbacks); return Future.value(_initWorked); } errorListener = onError; statusListener = onStatus; channel.setMethodCallHandler(_handleCallbacks); _initWorked = await channel.invokeMethod('initialize'); return _initWorked; }
My app access on database in backend mode after user terminated app, after update that issue show up to me
MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
I tested all solutions I know and I found in internet but I found nothing so I have disabled plugin one by one untilspeech_to_text : 0.8.0
after that database work great and issue has disappear .
i'm work on flutter 1.2
as title
log
I/flutter (15123): 2020-02-12 02:53:48.652658 FINE [Page] _speechInputCancel()
I/flutter (15123): 2020-02-12 02:53:48.653389 FINE [SpeechService] cancel()
I/flutter (15123): SpeechToText call: notifyStatus notListening
I/flutter (15123): 2020-02-12 02:53:48.655197 FINE [Page] _speechOnStatus()
I/flutter (15123): 2020-02-12 02:53:48.655383 FINEST [Page] available: true
I/flutter (15123): 2020-02-12 02:53:48.655480 FINEST [Page] listening: false
I/flutter (15123): 2020-02-12 02:53:48.656249 FINEST [Page] cancel:
...
I/flutter (15123): SpeechToText call: notifyError {"errorMsg":"error_no_match","permanent":true}
I/flutter (15123): 2020-02-12 02:53:49.042349 FINE [Page] _speechOnError()
I/flutter (15123): 2020-02-12 02:53:49.042699 FINEST [Page] error: SpeechRecognitionError msg: error_no_match, permanent: true
as comment of cancel()
/// Canceling means that there will be no final result returned from the
/// recognizer. Note Cannot be used until a successful [initialize] call.
is it because the "error no match" is partial result?
could you please make the api client, SpeechToText, able to config whether partial result is needed
kotlin```
272 putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true)
273 Log.d(logTag, "put partial")
thanks very much
Using the "flutter pub get" with ^0.7.2 in pubspec only get me the folder, with nothing inside.
The 0.7.1 downloads and works, but is not building for iOS.
I have also downloaded the 0.7.2 version and put in my project, but the channel invocation was not working.
Also, this week it was coming with some kind of corrupted data in the files.
I'm currently working with this plugin but it is annoying that every time I make a plugin call, everything that is happening behind the scenes is logged to my console. This can be conflictive with the logs that I'm using to debug my app and it is really tedious to browse through all the logs from the plugin to find 1 log from my app.
This should be eliminated from the plugin or at least add a flag that can be set to debug this calls like SpeechToText(debug: true)
I'm willing to help to do this if you need me to.
Thanks in advance
thanks
I have this error when i try to build for IOS
** BUILD FAILED **
Xcode's output:
↳
/Users/user921647/development/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.8.0/ios/Classes/SwiftSpeechToTextPlugin.swift:185:51: error: 'AVAudioSession.Category' (aka 'NSString') is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?
try self.audioSession.setCategory(rememberedAudioCategory)
^
as String
/Users/user921647/development/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.8.0/ios/Classes/SwiftSpeechToTextPlugin.swift:201:57: error: cannot assign value of type 'String' to type 'AVAudioSession.Category?' (aka 'Optional')
rememberedAudioCategory = self.audioSession.category
~~~~~~~~~~~~~~~~~~^~~~~~~~
as AVAudioSession.Category
/Users/user921647/development/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.8.0/ios/Classes/SwiftSpeechToTextPlugin.swift:202:71: error: type 'AVAudioSession.Category' (aka 'NSString') has no member 'playAndRecord'
try self.audioSession.setCategory(AVAudioSession.Category.playAndRecord)
~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~
/Users/user921647/development/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-0.8.0/ios/Classes/SwiftSpeechToTextPlugin.swift:203:63: error: type 'AVAudioSession.Mode' (aka 'NSString') has no member 'measurement'
try self.audioSession.setMode(AVAudioSession.Mode.measurement)
note: Using new build system
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)
All is fine for android
The 0.8.0 version is crashing the app sometimes in iOS. Is there any known issue related or something i must do to avoid crashing?
Works fine on Android.
Conversion of the speech to writing is complete, I want to take action but this methot not working. Can you help me?
i want use Listener for 5 minutes even after setting the listenFor Duration it stops listening can you help me with this
I want the listener to be active for 10 - 15 minutes.But when the listener is idle for few seconds it will stop listening . How should i restart the listener in that case?
Once there is an error like
1)notifyError {"errorMsg":"error_no_match","permanent":true}
2)notifyError {"errorMsg":"error_busy","permanent":true}
How do i restart the listener again.
If you do a recognition, click on stop and try again immediately, no text will be recognised. Only if you wait for approx 30 seconds, recognition will work again.
Running the example I realized that the stop button (speech.stop ()), does not work on my galaxy s10 +, but it does work on a galaxy s8
I'm trying no to upgrade my flutter to 1.12 and facing this issue any idea
`FAILURE: Build failed with an exception.
android Network timeout in China
I'm testing with an iOS version 13.2.3 and noticed that the result.finalResult variable is always returning me with the false value even at the end of the audio capture, but when I test with android the result.finalResult variable returns me the value true
I am trying to develop an app that requires this plugin. When I run the example app I noticed that you can not keep mic open for a longer time. If it doesn't listen to the voice it shuts down. Is it the android issue or I am not using the plugin in the right way
debug mode can speech_2_text,but release version can‘t speech_2_text?
after install in_app_purchase that depends on kotlin 3 I have facing issue with build so I remove speech_to_text and try install it again , now I can't
So, because stok_app_a depends on both speech_to_text ^0.6.3 and in_app_purchase ^0.2.2+4, version solving failed.
pub get failed (1; So, because stok_app_a depends on both speech_to_text ^0.6.3 and in_app_purchase ^0.2.2+4, version solving failed.)
The callback onError does not get triggered when the error type is ''error_no_match"
But there are logs from the library witch says that the error has been notified.
I/flutter (23187): SpeechToText call: textRecognition {"finalResult":false,"alternates":[{"recognizedWords":"","confidence":-1}]}
I/flutter (23187): SpeechToText call: notifyError {"errorMsg":"error_no_match","permanent":true}
An application was crashing with a sigabrt in speech_to_text occasionally. Sometimes when coming back into the foreground, sometimes while running. The stack trace pointed to the invokeFlutter method in speech_to_text. Looks like the parameters were incorrect in the case of a speechRecognizer availabilityDidChange callback.
#0 (null) in __exceptionPreprocess ()
#1 (null) in objc_exception_throw ()
#2 (null) in +[NSException raise:format:arguments:] ()
#3 (null) in -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] ()
#4 (null) in -[FlutterStandardWriter writeValue:] ()
#5 0x37553a in -[FlutterStandardMethodCodec encodeMethodCall:] ()
#6 0x3723f2 in -[FlutterMethodChannel invokeMethod:arguments:] ()
#7 0xc07ae6 in partial apply for closure #1 in SwiftSpeechToTextPlugin.invokeFlutter(_:arguments:) at /Users/.../speech_to_text/ios/Classes/SwiftSpeechToTextPlugin.swift:262
#8 (null) in thunk for @escaping @callee_guaranteed () -> () ()
#9 (null) in _dispatch_call_block_and_release ()
#10 (null) in _dispatch_client_callout ()
#11 (null) in _dispatch_main_queue_callback_4CF ()
#12 (null) in CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE ()
#13 (null) in __CFRunLoopRun ()
#14 (null) in CFRunLoopRunSpecific ()
#15 (null) in CFRunLoopRunInMode ()
#16 (null) in GSEventRunModal ()
#17 (null) in UIApplicationMain ()
Log:
I tried to build the project it gave me this errors
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
and this one too
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
Any help in this please ?
I'm aware that you can pass the onResult
function in the listen
method to the plugin. But that function is executed every time the plugin recognize words.
The thing that I want to do is execute a function when the plugin is all done with listening and recognizing. In fact, when the plugin reproduces the done audio in Android would be the perfect moment to execute a function.
Is there a way of doing this that I'm not aware of?
If that's possible, I think it would be helpful add it to the README for future reference to anyone with the same problem that I have.
Thanks
I created a new Flutter project to test the package using the pub.dev
example code. I saw that other issues mentioned iOS >=10, and Swift 5, so I modified Podfile with platform :ios, '13.2'
and config.build_settings['SWIFT_VERSION'] = '5'
. However, I get Swift complier errors. I'm guessing that I've missed something, but perhaps there is an issue.
Any help would be appreciated. Thanks for the package!
/Users/markvandergon/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-US)
• Flutter version 1.12.13+hotfix.8 at /Users/markvandergon/flutter
• Framework revision 0b8abb4724 (5 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/markvandergon/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Users/markvandergon/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6241897/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.9.1
[✓] Android Studio (version 3.6)
• Android Studio at /Users/markvandergon/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6241897/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• iPhone 11 Pro Max • 3F26DBDF-B967-49F4-8BF9-1D59768BDF74 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 5.6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/markvandergon/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-1.1.0/ios/Classes/SwiftSpeechToTextPlugin.swift:224:44: error: value of type 'SwiftSpeechToTextPlugin' has no member 'AVAudioSession'
rememberedAudioCategory = self.AVAudioSession.Category
~~~~ ^~~~~~~~~~~~~~
/Users/markvandergon/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-1.1.0/ios/Classes/SwiftSpeechToTextPlugin.swift:227:63: error: type 'Int' has no member 'notifyOthersOnDeactivation'
try self.audioSession.setActive(true, withFlags: .notifyOthersOnDeactivation)
~^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/markvandergon/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-1.1.0/ios/Classes/SwiftSpeechToTextPlugin.swift:245:9: warning: 'catch' block is unreachable because no errors are thrown in 'do' block
catch {
^
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Hello,
The example provided here doesn't work on my Samsung Galaxy S7 SM-G930F(Android 8.0.0). When I press the Start button and speak there is no recognized word or error shown.
I suppose the example should work on my device, so do you have any idea how could I find the source of the problem?
Update: I was able to test the same app on a Samsung Galaxy A5 2016 SM-A510F(Android 7.0) and the recognition works on that device.
Hi admins. I'm using your package for my project. I detected a occur when speech listening. That is when I don't speak anything, I received twice onError (I set print() inside onError). And I notice that this error occurs after I run for the second time onwards. I don't know how to explain it to you, sort of it doesn't get stopped listening. Or you can test with your example project, with your example I see Text("I'm listening...", style: TextStyle(fontWeight: FontWeight.bold),) instead of Text("Not listening", style: TextStyle(fontWeight: FontWeight.bold),).
So, I hope you can understand occur which I am getting, and help me to solve it. Thanks for your reading.
ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'java.lang.String android.content.Intent.resolveTypeIfNeeded(android.content.ContentResolver)' on a null object reference, null)
After a speech recognizer session the AVAudioSession play features aren't working.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.