watson-developer-cloudのiOS-sdkを使用して簡単なTextToSpeechを使用したアプリを開発しようとしてます。
そこで、以下のリンク先のQuickstart.mdに記載がある方法でアプリを作成してみましたが、TextToSpeechクラスを初期化するところで(TextToSpeech(username:string,password:string))、Thread1:signal SIGABRTのエラーが出てしまい、解決できずに困っています。。。ちなみにSpeechToTextも同じ方法でやってみましたが、同じように(SpeechToText(username:string,password:string))で同じエラーが出てしまいました。どなたか解決方法をご教授いただけないでしょうか??
■リンク先(Quickstart.mdの方法で実装しました。)
https://github.com/watson-developer-cloud/ios-sdk/tree/master/Documentation
■環境
iOS:10.1
xcode:8.1
■ソースコード( ViewController.swift)※usernameとpasswordは変更しています。
import UIKit
import AVFoundation
import TextToSpeechV1
class ViewController: UIViewController {
var audioPlayer : AVAudioPlayer! override func viewDidLoad() { super.viewDidLoad() let username = "username" let password = "password" let textToSpeech = TextToSpeech(username: username, password: password) let text = "All the problems of the world could be settled easily if men were only willing to think." let failure = { (error: Error) in print(error) } textToSpeech.synthesize(text, failure: failure) { data in self.audioPlayer = try! AVAudioPlayer(data: data) self.audioPlayer.play() } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }
}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/11/08 09:52
2016/11/08 09:53
2016/11/08 10:41
2016/11/08 11:12
2016/11/08 11:48
2016/11/09 07:48
2016/11/09 07:58
2016/11/11 03:33