I still need to figure out how to save the recorded buffer somewhere.
7PMEO4GFIWAEZYONKVRWYLF3UPOW6JWVX6LFRAJUGRENLN2JUEFQC
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":140,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":141,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":139,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
draw_play_button = function(word)
if Playing_source then return end
love.graphics.polygon('fill', {word.left-20, word.top,
word.left-5, word.top+10, word.left-20, word.top+20})
end
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":139,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":140,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":139,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
draw_record_button = function(word)
if word == Recording_word then
love.graphics.rectangle('fill', word.left-50, word.top, 20,20)
else
love.graphics.circle('fill', word.left-40, word.top+10, 10)
end
end
record = function(word_idx)
if Recording_device then
Recording_device:stop()
Recording_device = nil
Recording_word = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Recording_word = Words[word_idx]
Playing_source = nil
end
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":138,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":139,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":137,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":137,"on_record":95,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"Recording_word":138,"teach_mouse_release":46,"teach_key_release":56}
Recording_word = nil
record = function(word_idx)
if Recording_device then
Recording_device:stop()
Recording_device = nil
return
end
local devices = love.audio.getRecordingDevices()
if #devices == 0 then return end
Recording_device = devices[1]
Recording_device:start()
Playing_source = nil
end
{"Mode":2,"draw_teach_screen":110,"teach_text_input":49,"on.draw":5,"Words":12,"on.initialize":7,"Font_height":8,"learn_mouse_press":57,"Line_height":9,"learn_mouse_release":58,"learn_keychord_press":59,"draw_new_word_button":117,"learn_text_input":60,"fw_parent":136,"learn_key_release":61,"draw_recording_button":133,"draw_playing_button":130,"on.mouse_press":51,"draw_record_button":72,"on.mouse_release":52,"draw_play_button":75,"on.keychord_press":53,"on.key_release":55,"on.text_input":54,"Cursor_word":24,"Recording_device":132,"on_new_word_button":118,"new_word":64,"Playing_source":126,"on_word":80,"play":135,"to_word_idx":94,"on":1,"record":137,"draw_teach_word":68,"on_play":96,"fw_app":"spell-cards","draw_learn_screen":4,"teach_keychord_press":47,"teach_mouse_press":88,"on_record":95,"teach_mouse_release":46,"teach_key_release":56}