aws-amplify / aws-sdk-ios

AWS SDK for iOS. For more information, see our web site:
https://aws-amplify.github.io/docs
Other
1.68k stars 884 forks source link

Crash when trying to use TTS feature with Arabic content #2013

Closed dingua closed 4 years ago

dingua commented 5 years ago

Describe the bug When trying to use TTS feature with Arabic content and configuration the SDK crashes.

To Reproduce Steps to reproduce the behavior: If I configure the the request with Arabic configuration it crashes: let input = AWSPollySynthesizeSpeechURLBuilderRequest() input.outputFormat = AWSPollyOutputFormat.mp3 input.voiceId = AWSPollyVoiceId.zeina input.languageCode = AWSPollyLanguageCode.arb input.text = text

Log: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: VoiceId)' *** First throw call stack: ( 0 CoreFoundation 0x000000010679e6fb __exceptionPreprocess + 331 1 libobjc.A.dylib 0x0000000105907ac5 objc_exception_throw + 48 2 CoreFoundation 0x00000001066ecddc _CFThrowFormattedException + 194 3 CoreFoundation 0x000000010680d9d6 -[__NSDictionaryM setObject:forKey:] + 1046 4 AWSPolly 0x0000000104437ddf __54-[AWSPollySynthesizeSpeechURLBuilder getPreSignedURL:]_block_invoke + 1695 5 AWSCore 0x00000001030e3063 __63-[AWSTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke + 163 6 AWSCore 0x00000001030e276a __56-[AWSTask continueWithExecutor:block:cancellationToken:]_block_invoke + 106 7 AWSCore 0x0000000103085e4a __30+[AWSExecutor defaultExecutor]_block_invoke_2 + 186 8 AWSCore 0x00000001030866bf -[AWSExecutor execute:] + 95 9 AWSCore 0x00000001030e2610 -[AWSTask continueWithExecutor:block:cancellationToken:] + 864 10 AWSCore 0x00000001030e2f4d -[AWSTask continueWithExecutor:successBlock:cancellationToken:] + 317 11 AWSCore 0x00000001030e3124 -[AWSTask continueWithSuccessBlock:] + 132 12 AWSPolly 0x00000001044376df -[AWSPollySynthesizeSpeechURLBuilder getPreSignedURL:] + 223 Which AWS service(s) are affected? AWSPolly Expected behavior It should work fine, tried with English and it works just fine.

Screenshots If applicable, add screenshots to help explain your problem.

Environment(please complete the following information):

Device Information (please complete the following information):

Additional context Add any other context about the problem here.

dingua commented 4 years ago

is there any workaround for this ? it is a blocking the whole feature for Arabic and could be the same for other languages.

kneekey23 commented 4 years ago

hi @dingua have you tried calling this using Amplify Predictions instead? Set up here.

dingua commented 4 years ago

I went back and tested using Xcode 11 and so iOS 13 simulator and the crash is gone.