!7 !include once #1020738 // Base Include static void wavToMP3_128k(File wav, File mp3) { javaLame_wavToMP3_mono(wav, mp3); } // reacts to new recording or file path on clipboard module WitAILastRecording > DynPrintLog { bool sendUnrecognized; // annoying when in Alexa Mode start { dm_onNewRecordingOrWAVOnClipboard(voidfunc(File f) { print("Analyzing " + f.getName()); fS text = witAI_recognizeWAV(f); swing { S info = "wit.ai english"; if (empty(text)) { print("Didn't recognize any text"); if (sendUnrecognized) katze_userSaid(info, "?"); } else { S corrected = dm_correctRecognizedSpeech(text); if (neq(corrected, text)) { print("Correcting " + quote(text) + " to " + quote(corrected)); vmBus_send('correctedRecognizedSpeech, text, corrected); } else print("Recognized: " + text); if (!dm_osInForeground()) flatInfoBox(corrected); print("Recognized: " + corrected); dm_setAIBarTextAndFireWithInfo(corrected, info); } } }); } }