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"))
Speech Recognition
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()
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
VoiceKit is released under the MIT license. See LICENSE for details.