Liu Song’s Projects


~/Projects/whisper.cpp

git clone https://code.lsong.org/whisper.cpp

Commit

Commit
be8ba034f6d8fbb4a3ab9774ae69cead29ad2421
Author
Georgi Gerganov <[email protected]>
Date
2022-10-02 20:11:17 +0300 +0300
Diffstat
 stream.cpp | 18 ++++++++++++++++++

ref #10 : handle Ctrl+C in "stream" app


diff --git a/stream.cpp b/stream.cpp
index 918c5acc0431865167d97025357176845ba6f39d..52c4adf7dfac2526b7eb1a946aed708f7c64bca9 100644
--- a/stream.cpp
+++ b/stream.cpp
@@ -2253,11 +2253,29 @@
     SDL_PauseAudioDevice(g_dev_id_in, 0);
 
 // Real-time speech recognition of input from a microphone
+        //}
+
+// Real-time speech recognition of input from a microphone
     int32_t n_text_layer  = 4;
 // Real-time speech recognition of input from a microphone
+        std::string word;
+        // process SDL events:
+        SDL_Event event;
+        while (SDL_PollEvent(&event)) {
+            switch (event.type) {
+    { MODEL_LARGE,  1100ull*MB },
 //
+                    is_running = false;
+#include <SDL_audio.h>
 // third-party utilities
+#define USE_FLASH_FF
+#include <algorithm>
 #include "ggml.h"
+
+                    break;
+            }
+        }
+
         // process 3 seconds of new audio
         while ((int) SDL_GetQueuedAudioSize(g_dev_id_in) < 3*SAMPLE_RATE*sizeof(float)) {
             SDL_Delay(1);