flutter_tts
flutter_tts copied to clipboard
[AXTTSCommon] Invalid rule on IOS 16
On android devices all working good, but on iPhone 8 IOS 16 i get this message
[AXTTSCommon] Invalid rule: [AXTTSCommon] File file:///var/MobileAsset/AssetsV2/com_apple_MobileAsset_Trial_Siri_SiriTextToSpeech/purpose_auto/763c859a817bf66a99314ef00b97f263806afcf2.asset/AssetData/vocalizer-user-dict.dat contained data that was not null terminated [AXTTSCommon] Invalid rule:
This is my code
class _MyHomePageState extends State<MyHomePage> {
late FlutterTts _flutterTts;
@override
void initState() {
super.initState();
initTts();
}
void initTts() async {
_flutterTts = FlutterTts();
await _flutterTts.awaitSpeakCompletion(true);
}
Future speak() async {
await _flutterTts.setVolume(1);
await _flutterTts.setSpeechRate(0.5);
await _flutterTts.setPitch(1);
await _flutterTts.speak('Speak something');
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: TextButton(
onPressed: speak,
child: Text('Speak')),
),
);
}
}
library version: flutter_tts: ^3.6.2
flutter version: Flutter 3.3.8 • channel stable • https://github.com/flutter/flutter.git Framework • revision 52b3dc25f6 (2 weeks ago) • 2022-11-09 12:09:26 +0800 Engine • revision 857bd6b74c Tools • Dart 2.18.4 • DevTools 2.15.0
Hi, I also experienced the error reported by @PeakyCode. The TTS package is still working and the error only shows for me once or twice after I changed the default voice for the language in my iPhone settings (Settings -> Accessibility->Voices->[Japanese]) to a different one (ex. Kyoko (Japanese) to Otoya (Japanese)) . The word/sentence still got spoken but on first execution the error shows up in the console.
Tested on physical iPhone 13 device with iOS 16.1 installed.
I'm getting the same error as @PeakyCode when running on a iPhone SE 2nd gen with iOS 16. @dlutton do we know when it might be possible to have this issue fixed? I understand that it could be a while and developer time may be very limited.
@jasonmaclafferty thanks for the info, I'll need to do some research into this issue.
I'm getting the same error in iOS 16.
I'm having the same issue, also iOS 16. Additionally the sound output is about 5 seconds delayed. During this time, a lot of "Invalid rule" messages appear in the log.
I have the same issue on the real device with iOS 16.
[AXTTSCommon] Invalid rule:
[AXTTSCommon] File file:///var/MobileAsset/AssetsV2/com_apple_MobileAsset_Trial_Siri_SiriTextToSpeech/purpose_auto/f52d411b9d92ecd7f55947535cdb7753afe834c3.asset/AssetData/vocalizer-user-dict.dat contained data that was not null terminated
My app has a feature to speak words in the loop. When this feature is used, many [AXTTSCommon] Invalid rule:
messages are shown and the app crashes after 15 minutes with the following message. So, I think this issue can cause the app to crash due to memory.
43
[AXTTSCommon] Invalid rule:
* thread #36, name = 'com.apple.TextToSpeech.SpeechThread', queue = 'tts-regex-helper-queue', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=2098 MB, unused=0x0)
frame #0: 0x00000001addd69b8 CoreFoundation`__CFToUTF8 + 408
CoreFoundation`:
-> 0x1addd69b8 <+408>: strb w19, [x8, #0x2]
0x1addd69bc <+412>: lsr w21, w21, #6
0x1addd69c0 <+416>: mov w19, #0x80
0x1addd69c4 <+420>: bfxil w19, w21, #0, #6
Target 0: (Runner) stopped.
maybe related to this: https://developer.apple.com/forums/thread/718884
I'm experiencing the same issue you mentioned here. The message ([AXTTSCommon] Invalid rule:) keeps popping up while the TTS is speaking. Has anyone figured out how to fix it?
It's only happening on iOS. I'm using: Flutter 3.7.8 flutter_tts 3.6.3 iOS 16.4
Thanks!
It is affecting me too.
#311 Solved it for me.