NuanceDev / speechkit-ios-sample-swift

2 stars 1 forks source link

nil skSession #1

Open jkgneu12 opened 7 years ago

jkgneu12 commented 7 years ago

Reported by: @Catharsis68

There is an issue with ASR in the sample app. After viewDidLoad in SKSASRViewController there's an error. skSession = SKSession(url: URL(string: SKSServerUrl), appToken: SKSAppKey) and skSession is still nil.

jkgneu12 commented 7 years ago

@Catharsis68 I'm not seeing this. Are you using a simulator? What version of XCode? Thanks

Catharsis68 commented 7 years ago

Xcode 8.0 (8A218a) using simulator, iPhone 7 Plus

jkgneu12 commented 7 years ago

Thanks @Catharsis68 . It looks like this issue is being caused by "Keychain Sharing" being disabled. I'm working fixing it along with some other small issues. In the meantime, just enable Keychain Sharing in your app (under Capabilities).

jkgneu12 commented 7 years ago

@Catharsis68 Your issue should be fixed in latest release 2.2.2

Catharsis68 commented 7 years ago

The sample app works fine now, thank you! Within my app I replaced the 2.2.1 speechKit with the new 2.2.2 and activated "Keychain Sharing" as you said above. But still the skSession is nil. Are there any other changes I have to make?

jkgneu12 commented 7 years ago

@Catharsis68 You shouldn't need to make any other changes (but not 100% sure). I would say make sure all of the strings you are passing to the SKSession constructor are non-nil and are indeed your valid credentials.

Catharsis68 commented 7 years ago

I use the same credential strings for the sample app as for my own app. But in my app SKSession is still nil. Any other ideas?

jkgneu12 commented 7 years ago

@Catharsis68 The only other thing that comes to mind is adding NSMicrophoneUsageDescription to your Info.plist. This is required in iOS10.

    <key>NSMicrophoneUsageDescription</key>
    <string>Microphone access is required for speech recognition.</string>
Catharsis68 commented 7 years ago

The Privacy - Microphone Usage Description was already added to Info.plist. Tested the application with simulator and on device, still no initialization of SpeechKit possible.

jkgneu12 commented 7 years ago

@Catharsis68 Could send me logs or even relevant snippets of your app? Feel free to email me directly.

Iva90416 commented 7 years ago

2017-01-06 16:48:15.980 SpeechRecognition[1592:171544] failed with error = Error Domain=SpeechKitErrorDomain Code=4 "Cloud transaction reported an error." UserInfo={NSUnderlyingError=0x1655b740 {Error Domain=NMTErrorDomain Code=0 "(null)"}, NSLocalizedDescription=Cloud transaction reported an error.}

Iva90416 commented 7 years ago

Please help me.

Iva90416 commented 7 years ago

I am not sure what is issue, there is no error code in document. please help me asap.

jkgneu12 commented 7 years ago

@Iva90416 I would check your credentials. If you are using sandbox credentials they may be expired. You will need to login to Nuance Developers and "Extend Access".

Have you been able to perform transactions in the past? Did this just start happening?

Iva90416 commented 7 years ago

Thank you for your message, it was created a year ago and used by last May, i remember. so i signed up again, but cannot get email for verification. Could you help me?

jkgneu12 commented 7 years ago

@Iva90416 Can you still access your old account? If so then you should continue using it and just extend the sandbox access. If not, then please try to reset your password before creating a new account.

Iva90416 commented 7 years ago

cannot acess.

Iva90416 commented 7 years ago

I signed using another email.

Iva90416 commented 7 years ago

but didn't get email.

jkgneu12 commented 7 years ago

Did you check your spam folder? You can email me the the email address you used and I can look into it.

Iva90416 commented 7 years ago

combear35@yahoo.com

Iva90416 commented 7 years ago

already checked, but could not find.

Iva90416 commented 7 years ago

@jkgneu12 email : combear35@yahoo.com

jkgneu12 commented 7 years ago

@Iva90416 I created a ticket with our support team to resend the registration email. I will keep you posted

Iva90416 commented 7 years ago

Thank you. 👍

Iva90416 commented 7 years ago

@jkgneu12 Hi, I just got new key and tried, it was good at first, but second was not good. Please help me what is issue. Thank you.

NMT CloudRecognizer Error [Session ID: ] [Type:2] [Code:5] [Message:(null)] [ErrorParam:AUDIO_INFO] [Prompt:Sorry, speech not recognized. Please try again.]

Iva90416 commented 7 years ago

CloudRecognizer Error [Session ID: ] [Type:2] [Code:5] [Message:(null)] [ErrorParam:AUDIO_INFO] [Prompt:Sorry, speech not recognized. Please try again.] Failed with Error = Error Domain=SpeechKitErrorDomain Code=4 "Cloud transaction reported an error." UserInfo={NSUnderlyingError=0x1457b800 {Error Domain=NMTErrorDomain Code=5 "(null)"}, NSLocalizedDescription=Cloud transaction reported an error.}

jkgneu12 commented 7 years ago

@Iva90416 It looks like our system didn't recognize what you were saying. Try again?

Iva90416 commented 7 years ago

Ok, Thank you 👍

Iva90416 commented 7 years ago

Could you let me know a period time for recognition?

jkgneu12 commented 7 years ago

@Iva90416 You can set the SKTransactionEndOfSpeechDetection to Short, Long, or None. See docs: https://developer.nuance.com/public/Help/DragonMobileSDKReference_iOS/Speech-recognition.html#starting-a-transaction

Iva90416 commented 7 years ago

but it cannot be set in silver, they said. I mean options.

jkgneu12 commented 7 years ago

No it can. SKTransactionResultDeliveryProgressive cannot be set in silver

jkgneu12 commented 7 years ago

I highly recommend adding earcons to your application so you know when the system is listening. https://developer.nuance.com/public/Help/DragonMobileSDKReference_iOS/Audio-playback.html#earcons. There are sample audio files in the sample app that you can use.

jkgneu12 commented 7 years ago

You should also add UI feedback so that the user knows the system is listening to them. https://developer.nuance.com/public/Help/DragonMobileSDKReference_iOS/Volume-info.html

atb1983 commented 7 years ago

Hi, I'm still getting the error mentioned at the beginning of the thread skSession is still nil. or didFailWithError: Cloud transaction reported an error..

logs: NMT Recorder Started. Recorder Started. transactionDidBeginRecording NMT CloudRecognizer Error [Session ID:(null)] [Type:1] [Code:0] [Message:(null)] [ErrorParam:(null)] [Prompt:(null)] CloudRecognizer Error [Session ID:(null)] [Type:1] [Code:0] [Message:(null)] [ErrorParam:(null)] [Prompt:(null)] NMT Recorder Stopped. Recorder Stopped. didFailWithError: Cloud transaction reported an error..

I tried the latest sample code [2.2.2], iOS [Objective c and swift, even the android version. I made sure I have the right credentials [and my account is not expired], even I created two accounts for testing this. I tested using the iOS Simulator [iOS 10 and iOS 9.x] and two physical devices iPhone and iPad [iOS 10 and 9.3] and an Android Xiaomi MI5, I tested this in different places and network connections. I also tried to create a project from scratch and add the SDK from cocoapods. but I got similar results.

Am I missing something?

Thank you.

Alex Franco.

jkgneu12 commented 7 years ago

@atb1983 - I'm not sure what the problem is. It looks like the SKSession is being initialized, but you are having issues when you start the transaction.

Are you just downloading the sample app, inserting your credentials, and running the app?

Can you send the Android logs also?

ngbaanh commented 7 years ago

The sample problem with Sample App, I got a nil Session, too.

2017-02-16 09:08:36.090 SpeechKitSample[1289:31618] StreamingBufferSource Started. 2017-02-16 09:08:36.091 SpeechKitSample[1289:31618] StreamingBufferSource Stopped. 2017-02-16 09:08:36.131 SpeechKitSample[1289:31524] Started playing earcon 2017-02-16 09:08:36.524 SpeechKitSample[1289:31524] Finished playing earcon 2017-02-16 09:08:36.550 SpeechKitSample[1289:31618] NMT Recorder Started. 2017-02-16 09:08:36.551 SpeechKitSample[1289:31524] Recorder Started. 2017-02-16 09:08:37.659 SpeechKitSample[1289:31618] NMT CloudRecognizer Error [Session ID:(null)] [Type:1] [Code:0] [Message:(null)] [ErrorParam:(null)] [Prompt:(null)] 2017-02-16 09:08:37.661 SpeechKitSample[1289:31524] CloudRecognizer Error [Session ID:(null)] [Type:1] [Code:0] [Message:(null)] [ErrorParam:(null)] [Prompt:(null)] 2017-02-16 09:08:37.869 SpeechKitSample[1289:31618] NMT Recorder Stopped. 2017-02-16 09:08:37.870 SpeechKitSample[1289:31524] Recorder Stopped. 2017-02-16 09:08:37.877 SpeechKitSample[1289:31618] StreamingBufferSource Started. 2017-02-16 09:08:37.887 SpeechKitSample[1289:31618] StreamingBufferSource Stopped. 2017-02-16 09:08:38.309 SpeechKitSample[1289:31618] StreamingBufferSource Started. 2017-02-16 09:08:38.310 SpeechKitSample[1289:31618] StreamingBufferSource Stopped.

jkgneu12 commented 7 years ago

@ngbaanh @atb1983 - I am able to perform a successful speech recognition request with the Objective-C sample app I just downloaded (on iPhone simulator OS 10.0). The error you are getting looks like either incorrect, or expired, credentials.

  1. Double check your credentials
  2. Login to https://developer.nuance.com. Navigate to My Account. And make sure it says you have "Sandbox Access" and it is not expired. If it is expired, click "Extend Sandbox Access".
  3. If you are still getting the same error. You can email me your sample app and I can try to debug the issue.
atb1983 commented 7 years ago

Thank you, I sent you an email with my sample app. thanks a lot for your help

jkgneu12 commented 7 years ago

@ngbaanh @atb1983 - There is an issue w/ new accounts. We are looking into it now. I will let you know when I have an update.

atb1983 commented 7 years ago

Thanks for your update

selvinafernandes commented 7 years ago

Hi, I was able to use Nuance Speechkit in my app a few months ago while recently my credentials expired. I got the sandbox credentials extended but somehow I am unable to use the Nuance SpeechRecognition now. Below is the error that I get.

2017-02-16 16:49:28.112 Ivy[3065:102927] Recorder Started. 2017-02-16 16:49:28.432 Ivy[3065:103093] NMT CloudRecognizer Error [Session ID:(null)] [Type:1] [Code:0] [Message:(null)] [ErrorParam:(null)] [Prompt:(null)] 2017-02-16 16:49:28.432 Ivy[3065:102927] CloudRecognizer Error [Session ID:(null)] [Type:1] [Code:0] [Message:(null)] [ErrorParam:(null)] [Prompt:(null)] 2017-02-16 16:49:28.475 Ivy[3065:103093] NMT Recorder Stopped. 2017-02-16 16:49:28.475 Ivy[3065:102927] Recorder Stopped. didFailWithError: Error Domain=SpeechKitErrorDomain Code=4 "Cloud transaction reported an error." UserInfo={NSLocalizedDescription=Cloud transaction reported an error., NSUnderlyingError=0x7f994a71ce10 {Error Domain=NMTErrorDomain Code=0 "(null)"}}. Message from debugger: Terminated due to signal 15

jkgneu12 commented 7 years ago

@selvinafernandes thanks for extra info. Its the same issue as the others are facing. Will keep you posted.

jkgneu12 commented 7 years ago

@selvinafernandes @atb1983 @ngbaanh Can you please try again? This issue appears to be resolved.

selvinafernandes commented 7 years ago

@jkgneu12 Thanks. It works now :)

atb1983 commented 7 years ago

Yep, it's working now , thanks very much for your help jkgneu12

ngbaanh commented 7 years ago

@jkgneu12 : Thank you for your support, it works now.

Saravana181187 commented 7 years ago

I have a issue like this how to solve it..

failed with error = Error Domain=SpeechKitErrorDomain Code=4 "Cloud transaction reported an error." UserInfo={NSUnderlyingError=0x1655b740 {Error Domain=NMTErrorDomain Code=0 "(null)"}, NSLocalizedDescription=Cloud transaction reported an error.}

jkgneu12 commented 7 years ago

@Saravana181187 Was your app working before? Please make sure your sandbox credentials have not expired.