VoiceKit
Record
let speechRecorder = SpeechRecorder()
try! speechRecorder.record()
speechRecorder.stop()
try! speechRecorder.record(to: .document(filePath: "voice"))
try! speechRecorder.record(to: .temporary(filePath: "voice"))
Play
let speechPlayer = SpeechPlayer()
try! speechPlayer.play { _ in
print("finished")
}
speechPlayer.stop()
try! speechPlayer.play(url: .web(url: "https://hoge.com"))
try! speechPlayer.record(url: .document(filePath: "voice"))
语音识别
let speechRecognizer = SpeechRecognizer(locale: .init(identifier: "ja_JP"))!
try! speechRecognizer.recognize(url: .defaultURL) { (text, isFinal, error) in
if isFinal || error != nil {
print("finished")
}
self.textView.text = text
}
speechRecognizer.stop()
参与贡献
- Fork它!
- 创建新的功能分支:
git checkout -b my-new-feature
- 提交您的更改:
git commit -am '添加一些功能'
- 推送到分支:
git push origin my-new-feature
- 提交pull请求 :D
许可证
VoiceKit遵循MIT许可证发布。详细信息请参见LICENSE。