]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper.objc : fix context + broken readme links
authorGeorgi Gerganov <redacted>
Sun, 27 Nov 2022 08:48:59 +0000 (10:48 +0200)
committerGeorgi Gerganov <redacted>
Sun, 27 Nov 2022 08:52:27 +0000 (10:52 +0200)
examples/command.wasm/README.md
examples/command/README.md
examples/whisper.objc/README.md
examples/whisper.objc/whisper.objc/ViewController.m

index a6e0cf1838bec5af91fb2d703fd0f7a820b9dd67..d317f3a9a89366d99383c0b206824ecd027bb61e 100644 (file)
@@ -5,7 +5,7 @@ It runs in fully in the browser via WebAseembly.
 
 Online demo: https://whisper.ggerganov.com/command/
 
-Terminal version: https://github.com/ggerganov/whisper.cpp/examples/command
+Terminal version: [examples/command](/examples/command)
 
 ## Build instructions
 
index de8b61caa59f218fe2fe0d877196ed60e19ce1a5..3a521fb94440aeab5ff2fb21bc261333505cee90 100644 (file)
@@ -13,7 +13,7 @@ More info is available in [issue #171](https://github.com/ggerganov/whisper.cpp/
 \r
 https://user-images.githubusercontent.com/1991296/204038393-2f846eae-c255-4099-a76d-5735c25c49da.mp4\r
 \r
-Web version: https://github.com/ggerganov/whisper.cpp/examples/command.wasm\r
+Web version: [examples/command.wasm](/examples/command.wasm)\r
 \r
 ## Building\r
 \r
index 05c661331b2549c3f397dc138db4282639581285..53172829ceff90647d1d4c51ae3df8c200b1199c 100644 (file)
@@ -5,6 +5,10 @@ The inference runs locally, on-device.
 
 https://user-images.githubusercontent.com/1991296/197385372-962a6dea-bca1-4d50-bf96-1d8c27b98c81.mp4
 
+Real-time transcription demo:
+
+https://user-images.githubusercontent.com/1991296/204126266-ce4177c6-6eca-4bd9-bca8-0e46d9da2364.mp4
+
 ## Usage
 
 ```java
index d294178bcbb9a8f362659a3882c0668b49d6c964..d6aef36924527f64101f9eda89f3e8fa7ab65755 100644 (file)
@@ -198,6 +198,7 @@ void AudioInputCallback(void * inUserData,
         params.language         = "en";
         params.n_threads        = max_threads;
         params.offset_ms        = 0;
+        params.no_context       = true;
         params.single_segment   = self->stateInp.isRealtime;
 
         CFTimeInterval startTime = CACurrentMediaTime();
@@ -228,8 +229,11 @@ void AudioInputCallback(void * inUserData,
             result = [result stringByAppendingString:[NSString stringWithUTF8String:text_cur]];
         }
 
+        const float tRecording = (float)self->stateInp.n_samples / (float)self->stateInp.dataFormat.mSampleRate;
+
         // append processing time
-        result = [result stringByAppendingString:[NSString stringWithFormat:@"\n\n[processing time: %5.3f s]", endTime - startTime]];
+        result = [result stringByAppendingString:[NSString stringWithFormat:@"\n\n[recording time:  %5.3f s]", tRecording]];
+        result = [result stringByAppendingString:[NSString stringWithFormat:@"  \n[processing time: %5.3f s]", endTime - startTime]];
 
         // dispatch the result to the main thread
         dispatch_async(dispatch_get_main_queue(), ^{