{"action":"created","issue":{"url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/issues/168","repository_url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk","labels_url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/issues/168/comments","events_url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/issues/168/events","html_url":"https://github.com/watson-developer-cloud/ios-sdk/issues/168","id":128301542,"number":168,"title":"[speech-to-text] Redesign SpeechToText implementation","user":{"login":"glennrfisher","id":1957636,"avatar_url":"https://avatars.githubusercontent.com/u/1957636?v=3","gravatar_id":"","url":"https://api.github.com/users/glennrfisher","html_url":"https://github.com/glennrfisher","followers_url":"https://api.github.com/users/glennrfisher/followers","following_url":"https://api.github.com/users/glennrfisher/following{/other_user}","gists_url":"https://api.github.com/users/glennrfisher/gists{/gist_id}","starred_url":"https://api.github.com/users/glennrfisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennrfisher/subscriptions","organizations_url":"https://api.github.com/users/glennrfisher/orgs","repos_url":"https://api.github.com/users/glennrfisher/repos","events_url":"https://api.github.com/users/glennrfisher/events{/privacy}","received_events_url":"https://api.github.com/users/glennrfisher/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/labels/speech-to-text","name":"speech-to-text","color":"bfdadc"}],"state":"open","locked":false,"assignee":{"login":"glennrfisher","id":1957636,"avatar_url":"https://avatars.githubusercontent.com/u/1957636?v=3","gravatar_id":"","url":"https://api.github.com/users/glennrfisher","html_url":"https://github.com/glennrfisher","followers_url":"https://api.github.com/users/glennrfisher/followers","following_url":"https://api.github.com/users/glennrfisher/following{/other_user}","gists_url":"https://api.github.com/users/glennrfisher/gists{/gist_id}","starred_url":"https://api.github.com/users/glennrfisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennrfisher/subscriptions","organizations_url":"https://api.github.com/users/glennrfisher/orgs","repos_url":"https://api.github.com/users/glennrfisher/repos","events_url":"https://api.github.com/users/glennrfisher/events{/privacy}","received_events_url":"https://api.github.com/users/glennrfisher/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/milestones/9","html_url":"https://github.com/watson-developer-cloud/ios-sdk/milestones/Release%200.2.0:%20SpeechToText","labels_url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/milestones/9/labels","id":1463587,"number":9,"title":"Release 0.2.0: SpeechToText","description":"Redesign Speech to Text implementation.","creator":{"login":"vherrin","id":2422521,"avatar_url":"https://avatars.githubusercontent.com/u/2422521?v=3","gravatar_id":"","url":"https://api.github.com/users/vherrin","html_url":"https://github.com/vherrin","followers_url":"https://api.github.com/users/vherrin/followers","following_url":"https://api.github.com/users/vherrin/following{/other_user}","gists_url":"https://api.github.com/users/vherrin/gists{/gist_id}","starred_url":"https://api.github.com/users/vherrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vherrin/subscriptions","organizations_url":"https://api.github.com/users/vherrin/orgs","repos_url":"https://api.github.com/users/vherrin/repos","events_url":"https://api.github.com/users/vherrin/events{/privacy}","received_events_url":"https://api.github.com/users/vherrin/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":7,"state":"open","created_at":"2015-12-16T17:05:38Z","updated_at":"2016-02-03T15:16:06Z","due_on":"2016-02-06T06:00:00Z","closed_at":null},"comments":6,"created_at":"2016-01-23T04:53:52Z","updated_at":"2016-02-07T23:30:59Z","closed_at":null,"body":"Transition the programming model from a delegate pattern to a completion handler pattern.\r\n\r\nGeneral API Functionality:\r\n- [ ] Discrete audio transcription\r\n- [ ] Continuous audio transcription with microphone\r\n- [ ] Continuous audio transcription with `AVCaptureOutput`\r\n\r\nRequested Features:\r\n- [ ] [Minimize connection time](https://github.com/watson-developer-cloud/ios-sdk/issues/147#issuecomment-169557029)\r\n- [ ] [Access data to visualize waveform](https://github.com/watson-developer-cloud/ios-sdk/issues/152#issuecomment-169542020)\r\n- [ ] [Return complete response model](https://github.com/watson-developer-cloud/ios-sdk/issues/152#issuecomment-169578400)\r\n- [ ] [Save sent audio as a file](https://github.com/watson-developer-cloud/ios-sdk/issues/159#issue-125337582)\r\n- [ ] [Produce error on audio format mismatch](https://github.com/watson-developer-cloud/ios-sdk/issues/164#issuecomment-173924856)\r\n- [ ] [Update documentation to reflect new implementation](https://github.com/daniel-bolanos)\r\n- [ ] [Ensure completion handler is always called, even for silent audio.](https://github.com/watson-developer-cloud/ios-sdk/issues/174)\r\n- [ ] Execute the completion handler with an error if credentials are invalid.\r\n\r\nAPI Stub:\r\n\r\n```swift\r\npublic class SpeechToText {\r\n\r\n    public init() { }\r\n\r\n    /**\r\n     Transcribe pre-recorded audio data.\r\n    \r\n     - parameter audio: The pre-recorded audio data.\r\n     - parameter settings: Settings to configure the SpeechToText service.\r\n     - parameter onInterim: A callback function to execute with interim transcription results from\r\n        the SpeechToText service. This callback function will be executed exactly once for each\r\n        interim transcription result produced by the SpeechToText service. Note that the\r\n        SpeechToText `interimResults` setting must be `true` for the service to return interim\r\n        transcription results.\r\n     - parameter completionHandler: A function that will be executed with all final transcription\r\n        results from the SpeechToText service, or an error if an error occured.\r\n     */\r\n    public func transcribe(\r\n        audio: NSData,\r\n        settings: SpeechToTextConfiguration,\r\n        onInterim: ((SpeechToTextResponse?, NSError?) -> Void)? = nil,\r\n        completionHandler: ([SpeechToTextResponse]?, NSError?) -> Void)\r\n    {\r\n        // 1. Set up SpeechToText with client-specified settings.\r\n        // 2. Send the given audio data to the SpeechToText service.\r\n        // 3. Execute the onInterim function for each interim transcription result.\r\n        // 4. Execute the completionHandler with all final transcription results (or an error).\r\n    }\r\n\r\n    /**\r\n     Start the microphone and stream the recording to the SpeechToText service for a live\r\n     transcription. The microphone will stop recording after an end-of-speech event is detected\r\n     by SpeechToText or the stopRecording function is executed.\r\n\r\n     - parameter settings: The settings used to configure the SpeechToText service.\r\n     - parameter onInterim: A callback function to execute with interim transcription results from\r\n        the SpeechToText service. This callback function will be executed exactly once for each\r\n        interim transcription result produced by the SpeechToText service. Note that the\r\n        SpeechToText `interimResults` setting must be `true` for the service to return interim\r\n        transcription results.\r\n     - parameter completionHandler: A function that will be executed with all final transcription\r\n        results from the SpeechToText service, or an error if an error occured.\r\n\r\n     - returns: A stopRecording function that can be executed to stop the microphone's recording,\r\n        wait for any remaining transcription results to be returned by the SpeechToText service,\r\n        then execute the completionHandler.\r\n     */\r\n    public func transcribe(\r\n        settings: SpeechToTextConfiguration,\r\n        onInterim: ((SpeechToTextResponse?, NSError?) -> Void)? = nil,\r\n        completionHandler: ([SpeechToTextResponse]?, NSError?) -> Void)\r\n        -> StopRecording\r\n    {\r\n        // 1. Set up SpeechToText with client-specified settings.\r\n        // 2. Start the microphone.\r\n        // 3. Stream microphone audio to the SpeechToText service.\r\n        // 4. Execute the onInterim function for each interim transcription result.\r\n        // 5. Continue until:\r\n        //      a. The client executes the stopRecording function, or\r\n        //      b. The SpeechToText service detects an \"end of speech\" event, or\r\n        //      c. The SpeechToText service times out (either session timeout or inactivity timeout).\r\n        // 6. Execute the completionHandler with all final transcription results (or an error).\r\n    }\r\n}\r\n\r\n// StopRecording is a function that can be used to forcibly stop recording the microphone and sending\r\n// audio to the Speech to Text service. (We use a typealias to enhance the expressiveness of our API.)\r\ntypealias StopRecording = Void -> Void\r\n```"},"comment":{"url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/issues/comments/181139800","html_url":"https://github.com/watson-developer-cloud/ios-sdk/issues/168#issuecomment-181139800","issue_url":"https://api.github.com/repos/watson-developer-cloud/ios-sdk/issues/168","id":181139800,"user":{"login":"dsato80","id":15008358,"avatar_url":"https://avatars.githubusercontent.com/u/15008358?v=3","gravatar_id":"","url":"https://api.github.com/users/dsato80","html_url":"https://github.com/dsato80","followers_url":"https://api.github.com/users/dsato80/followers","following_url":"https://api.github.com/users/dsato80/following{/other_user}","gists_url":"https://api.github.com/users/dsato80/gists{/gist_id}","starred_url":"https://api.github.com/users/dsato80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsato80/subscriptions","organizations_url":"https://api.github.com/users/dsato80/orgs","repos_url":"https://api.github.com/users/dsato80/repos","events_url":"https://api.github.com/users/dsato80/events{/privacy}","received_events_url":"https://api.github.com/users/dsato80/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T23:30:59Z","updated_at":"2016-02-07T23:30:59Z","body":"Hi @glennrfisher , \r\n\r\nYes! currently I'm using the former SDK written in objective-c with some fixes by myself but it is deprecated unfortunately. So I want to shift to this new SDK. \r\nI will be able to work for this next week. I hope you will finish the merge this week!\r\n"}}