initializeSpeechRecognition: ->
@recognition = new webkitSpeechRecognition()
@recognition.lang = 'ja-JP'
@recognition.continuous = true
@recognition.interimResults = false
@recognition.start()
@recognition.onend = (e) =>
@recognition.start()
recordVoiceResults: ->
@recognition.onresult = (e) =>
result = e.results[e.resultIndex]
transcript = result[0].transcript.trim()
if typeof(webkitSpeechRecognition) == typeof(Function)
@initializeSpeechRecognition()
var match = instruction.match(/^(.+)は(.+)です$/);
if (match) {
switch (match[1]) {
case "名前":
// 名前を設定
break;
case "都道府県":
// 都道府県を設定
break;
case "生年月日":
// 生年月日を設定
}
} else if (instruction == "スライドに行ってください") {
// スライドに遷移
}