flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

App crashing on macOS when trying to read specific strings in Korean

Open hyungtaecf opened this issue 1 year ago • 0 comments

🐛 Bug Report

The app crashes on macOS when trying to read specific strings in Korean.

This example is the word 손 (meaning: hand) - I also notice it happens with the alphabet letters like "ㄴ" and "ㄹ". It speaks the letter name on Android devices without crashing.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString substringWithRange:]: Range {1, 18446744073709551614} out of bounds; string length 1' *** First throw call stack: ( 0 CoreFoundation 0x00007ff813a5e7b3 __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007ff8137bebc3 objc_exception_throw + 48 2 CoreFoundation 0x00007ff813b19f8c _CFThrowFormattedException + 202 3 CoreFoundation 0x00007ff8139d185e -[NSConstantDictionary objectForKey:] + 0 4 flutter_tts 0x0000000103c43a7d $s11flutter_tts16FlutterTtsPluginC17speechSynthesizer_28willSpeakRangeOfSpeechString9utteranceySo08AVSpeechG0C_So8_NSRangeVSo0O9UtteranceCtF + 797 5 flutter_tts 0x0000000103c43c87 $s11flutter_tts16FlutterTtsPluginC17speechSynthesizer_28willSpeakRangeOfSpeechString9utteranceySo08AVSpeechG0C_So8_NSRangeVSo0O9UtteranceCtFTo + 87 6 AXSpeechImplementation 0x00000001047cbc09 -[AVSpeechSynthesizer(Implementation) _handleSpeechWordCallback:wordRange:channel:] + 746 7 libdispatch.dylib 0x00007ff8137640cc _dispatch_call_block_and_release + 12 8 libdispatch.dylib 0x00007ff813765317 _dispatch_client_callout + 8 9 libdispatch.dylib 0x00007ff813771c78 _dispatch_main_queue_drain + 943 10 libdispatch.dylib 0x00007ff8137718bb _dispatch_main_queue_callback_4CF + 31 11 CoreFoundation 0x00007ff813a20f07 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 12 CoreFoundation 0x00007ff8139e1fef __CFRunLoopRun + 2771 13 CoreFoundation 0x00007ff8139e0e5c CFRunLoopRunSpecific + 562 14 HIToolbox 0x00007ff81c6885e6 RunCurrentEventLoopInMode + 292 15 HIToolbox 0x00007ff81c68834a ReceiveNextEventCommon + 594 16 HIToolbox 0x00007ff81c6880e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70 17 AppKit 0x00007ff8164201fd _DPSNextEvent + 927 18 AppKit 0x00007ff81641e8ba -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394 19 AppKit 0x00007ff816410f69 -[NSApplication run] + 586 20 AppKit 0x00007ff8163e4ee7 NSApplicationMain + 817 21 klyrix 0x000000010338af29 main + 9 22 dyld 0x000000011248551e start + 462 ) libc++abi: terminating with uncaught exception of type NSException "macOS => call play, playerId 2ebb3351-9ec9-40fa-b513-5f721a77e8fd" "" "macOS => call release, playerId 2ebb3351-9ec9-40fa-b513-5f721a77e8fd" "macOS => call play, playerId 2106846c-e2e9-4dd1-b13d-8aa24c49c656" "" "macOS => call release, playerId 2106846c-e2e9-4dd1-b13d-8aa24c49c656" "macOS => call play, playerId e3c7e93f-63ed-45b1-858a-877c1802cc01" "" "macOS => call release, playerId e3c7e93f-63ed-45b1-858a-877c1802cc01" Lost connection to device.

Expected behavior

The app not crashing would be nice...

Reproduction steps

(Tried adding await flutterTts.awaitSpeakCompletion(true); before and it doesn't help)

  • flutterTts.speak(voiceText);

Configuration

Version: 3.5.0

Platform: macOS

hyungtaecf avatar Jul 29 '22 19:07 hyungtaecf