Spaces:
Running
Running
Close file after writing in server application (#1533)
Browse filesFix of mistake leaving file open while reading it again as wav
examples/server/server.cpp
CHANGED
|
@@ -456,6 +456,7 @@ int main(int argc, char ** argv) {
|
|
| 456 |
// write file to temporary file
|
| 457 |
std::ofstream temp_file{filename, std::ios::binary};
|
| 458 |
temp_file << audio_file.content;
|
|
|
|
| 459 |
|
| 460 |
// read wav content into pcmf32
|
| 461 |
if (!::read_wav(filename, pcmf32, pcmf32s, params.diarize)) {
|
|
|
|
| 456 |
// write file to temporary file
|
| 457 |
std::ofstream temp_file{filename, std::ios::binary};
|
| 458 |
temp_file << audio_file.content;
|
| 459 |
+
temp_file.close();
|
| 460 |
|
| 461 |
// read wav content into pcmf32
|
| 462 |
if (!::read_wav(filename, pcmf32, pcmf32s, params.diarize)) {
|