]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
Close file after writing in server application (#1533)
authorFelix <redacted>
Tue, 21 Nov 2023 19:36:10 +0000 (20:36 +0100)
committerGitHub <redacted>
Tue, 21 Nov 2023 19:36:10 +0000 (20:36 +0100)
Fix of mistake leaving file open while reading it again as wav

examples/server/server.cpp

index 41e162f39750c50ddc35f0f22297ec6dcf2064cf..1ea6d31d6c4dafb81d7250a502a99d663a5f2e1b 100644 (file)
@@ -456,6 +456,7 @@ int main(int argc, char ** argv) {
         // write file to temporary file
         std::ofstream temp_file{filename, std::ios::binary};
         temp_file << audio_file.content;
+        temp_file.close();
 
         // read wav content into pcmf32
         if (!::read_wav(filename, pcmf32, pcmf32s, params.diarize)) {